Easily Edit Linux Files from Windows/Mac via SSH
Abstract
Editing Linux files from a Windows or Mac system can be easily achieved using Visual Studio Code (VS Code) and its Remote - SSH extension. Here’s a step-by-step guide to set this up.
Step-by-Step Guide
-
Install Visual Studio Code
- Download and install Visual Studio Code from here.
-
Install the Remote - SSH Plugin
- Open Visual Studio Code.
- Click on the 'Extensions' icon in the navigation bar on the left.
- Search for "Remote - SSH" and click 'Install'.
-
Install the YAML Plugin (Optional)
- If you plan on editing YAML files, it can be useful to install the "YAML" plugin.
- Search for "YAML" in the Extensions view and install it.
Connect to a Remote Server via SSH
-
Open Remote Explorer
- Click on the 'Remote Explorer' icon in the navigation bar on the left.
-
Add a New Remote Session
-
Click on the plus icon to add a new remote session.
-
Fill in the connection details:
- Press Enter, and then press Enter again to confirm the save location of the SSH configuration.
-
-
View and Connect to the Remote Session
- You should see the remote session appear in the list. If it doesn’t appear immediately, try closing and reopening Visual Studio Code.
- Click the arrow next to your remote session to connect.
- Follow the prompts and enter your password when prompted.
- You should see the remote session appear in the list. If it doesn’t appear immediately, try closing and reopening Visual Studio Code.
-
Open a Folder on Your Server
- In the Explorer tab on the left, you can open a folder on your remote server that you wish to edit.
Now you are all set to edit your Linux files from your Windows or Mac system using Visual Studio Code!