Skip to content

Easily Edit Linux Files from Windows/Mac via SSH

HardDrive

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

  1. Install Visual Studio Code

    • Download and install Visual Studio Code from here.
  2. 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'. edit-linux-files
  3. 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. edit-linux-files

Connect to a Remote Server via SSH

  1. Open Remote Explorer

    • Click on the 'Remote Explorer' icon in the navigation bar on the left.
  2. Add a New Remote Session

    • Click on the plus icon to add a new remote session.
      edit-linux-files

    • Fill in the connection details:

      ssh <username>@<ip address of your server>
      

    • Press Enter, and then press Enter again to confirm the save location of the SSH configuration.
  3. 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.
      edit-linux-files
    • Click the arrow next to your remote session to connect.
      edit-linux-files
    • Follow the prompts and enter your password when prompted.
      edit-linux-files
  4. 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!