This guide walks through three essential steps for modern software development:
- Installing and configuring Visual Studio Code on macOS and Windows
- Setting up SSH access to a Linux (Ubuntu) system using SSH keys
- Remotely editing files on the Linux system directly from VS Code
This is the workflow we’ll use throughout the course.
A Linux system is available for you to use at IP address 10.192.145.179.
Part 1: Installing Visual Studio Code (VS Code)
macOS
- Go to:
https://code.visualstudio.com/ - Download the macOS version.
- Open the downloaded
.zipfile and drag Visual Studio Code into the Applications folder. - Launch VS Code from Applications.
- (Recommended) Enable the
codecommand:- Press Cmd–Shift–P
- Type:
Shell Command: Install 'code' command in PATH - Press Enter
This allows you to launch VS Code from the terminal using:
code .
Windows
- Go to:
https://code.visualstudio.com/ - Download the Windows installer.
- Run the installer and accept the defaults.
- When prompted, check the box:
- “Add to PATH”
- Launch VS Code from the Start Menu.
Part 2: Logging into a Linux (Ubuntu) System Using SSH
You will connect to a remote Linux system using SSH (Secure Shell).
Step 1: Open a terminal
- macOS: Open Terminal
- Windows: Open PowerShell (or Windows Terminal)
Step 2: Generate an SSH key (do this once)
Run:
ssh-keygen -t ed25519
When prompted:
- Press Enter to accept the default file location
- Press Enter again for no passphrase (or set one if you prefer)
This creates:
- A private key (keep secret)
- A public key (safe to share)
Step 3: Copy your public key to the Linux server
Assuming:
- Your Linux username is
username - Your server is
10.192.145.179
Run:
ssh-copy-id username@server.example.edu
If ssh-copy-id is not available (some Windows systems), do this instead:
cat ~/.ssh/id_ed25519.pub
Copy the output, then log into the server with:
ssh username@server.example.edu
On the server:
mkdir -p ~/.ssh nano ~/.ssh/authorized_keys
Paste the key, save, and exit.
Step 4: Test login
From your local machine:
ssh username@server.example.edu
You should now log in without a password.
Part 3: Remote Editing on Linux Using VS Code
VS Code can edit files directly on the remote Linux system using SSH.
Step 1: Install the Remote SSH extension
- Open VS Code
- Click the Extensions icon (left sidebar)
- Search for:
Remote - SSH - Install it (by Microsoft)
Step 2: Connect to the Linux server
- Press Cmd–Shift–P (macOS) or Ctrl–Shift–P (Windows)
- Type:
Remote-SSH: Connect to Host - Choose Add New SSH Host
- Enter:
ssh username@server.example.edu - Select the default SSH config file
- Confirm the connection
VS Code will open a new window connected to the Linux system.
Step 3: Open and edit files remotely
Once connected:
- Click File → Open Folder
- Choose a directory on the Linux machine (e.g.,
~/projects) - Open a terminal inside VS Code:
- View → Terminal
You are now:
- Editing files on Linux
- Running Linux commands
- Compiling and running programs on the remote machine
All edits happen remotely, but feel like local editing.
Common Commands (Run in VS Code Terminal)
ls cd project_name make ./program_name git status git pull git push
Troubleshooting Tips
- If SSH fails, verify:
- Correct username
- Correct server name
- Your public key is in
~/.ssh/authorized_keyson the server
- If VS Code hangs on first connect:
- Be patient — it installs a small server on Linux the first time
- If VS Code won’t reconnect:
- Run
ssh username@server.example.edumanually to test SSH first
- Run
Summary
By the end of this setup, you should be able to:
- Use VS Code on your laptop
- Log into a Linux server securely with SSH keys
- Edit, build, and run programs on Linux directly from VS Code
This is the same workflow used by professional software engineers working on remote systems.
