SSH Connection & Dev Environment Guide
Each step is labeled for Local Machine (your laptop before SSH) or Server Side (after logging into
babylon).- Read the explanation before running commands.
Windows users: install WSL (Ubuntu). PowerShell differs from Linux/macOS and can be confusing.
Conda is recommended. A
venvfallback is provided but is less robust for scientific stacks.VS Code is recommended for editing/running code on the server.
Orientation: What You’re Setting Up and Why
What is SSH (in plain language)?
SSH (Secure Shell) lets you control another computer (the
server) from your laptop (the local machine)
over an encrypted connection. In this course, you will log into
babylon.eecs.oregonstate.edu to run tools and code that live on the server.
You must be either:
- On the Oregon State campus network, or
Connected through the official OSU VPN: OSU VPN
Keys vs Passwords (why we use SSH keys)
Passwords are easy to mistype and insecure to reuse. SSH keys are like ID cards: you generate a keypair (private + public) on your laptop, copy the public key to the server, and keep the private key safe locally. After setup, you log in without typing your password each time.
Editor choice (why VS Code Remote SSH)
VS Code Remote SSH lets you open, edit, and run files stored on the server while using a familiar editor on your laptop.
Environments (why Conda)
Different projects need different Python versions and libraries. Conda (Miniforge) manages that cleanly and avoids many dependency hassles.
Windows Preparation (Local Machine)
Install WSL (Ubuntu)
Install WSL (PowerShell as Administrator)
wsl --install -d Ubuntu
Reboot if prompted. Then open the Ubuntu app from the Start menu. Use this terminal for all steps labeled Linux/macOS/WSL .
Check Windows OpenSSH Client (optional)
Verify or Install OpenSSH Client (PowerShell)
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Install VS Code & Remote SSH (Local Machine)
Why this matters: You'll edit server files using your local VS Code. The Remote SSH extension installs a helper on the server automatically.
Install VS Code + Remote SSH
# 1) Install Visual Studio Code
# 2) Open Extensions (Ctrl+Shift+X) → install "Remote - SSH"
Create SSH Keys (Local Machine)
Where the keys live: ~/.ssh (hidden folder). The private key (e.g., id_ed25519) must remain secret; the public key (id_ed25519.pub) is safe to share with servers.
Generate SSH Key (Linux/macOS/WSL)
ssh-keygen -t ed25519 -C "onid@oregonstate.edu"
You can press Enter to accept the default path ~/.ssh/id_ed25519 or use your
own path, please make sure they are still located in ~/.ssh. Set a
passphrase if you want extra protection.
Optional: Use an SSH agent (avoids re-typing passphrase)
Start agent & add key (Linux/macOS/WSL)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
Start agent & add key (Windows PowerShell)
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
ssh-add $env:USERPROFILE\\.ssh\\id_ed25519
Copy Your Public Key to the Server
What this does: places your public key in ~/.ssh/authorized_keys on the server so it trusts your key.
Copy key (Linux/macOS/WSL)
ssh-copy-id -i ~/.ssh/id_ed25519.pub onid@babylon.eecs.oregonstate.edu
Copy key (Windows PowerShell fallback)
type $env:USERPROFILE\\.ssh\\id_ed25519.pub | ssh onid@babylon.eecs.oregonstate.edu "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
Fix server-side permissions (run after login)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
If you pasted from Windows and login still fails, convert CRLF to LF on the server:
sed -i 's/\r$//' ~/.ssh/authorized_keys
Test Your SSH Login
Goal: log in without typing your ONID password.
Test connection (Local Machine)
ssh onid@babylon.eecs.oregonstate.edu
Some students may not yet have permission to use
babylon.eecs.oregonstate.edu. If you see Permission denied, you can
temporarily use the flip server at access.engr.oregonstate.edu. Please
notify the course TAs to request Babylon access.
Success looks like: a remote shell prompt (e.g.,
onid@babylon:~$) and no password prompt. If you set a passphrase, your agent
should handle it after you add the key.
Use VS Code Remote SSH
Once keys work, VS Code can open your server folders for editing, terminals, and debugging.
Connect via VS Code (Local Machine)
F1 → Remote-SSH: Connect to Host → onid@babylon.eecs.oregonstate.edu
Select remote OS: Linux
Make connection easier with SSH config (recommended)
Create or edit ~/.ssh/config on your local machine:
Basic host entry (Local Machine)
Host babylon
HostName babylon.eecs.oregonstate.edu
User onid
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 120
ServerAliveCountMax 300
Permissions for SSH config
chmod 600 ~/.ssh/config
Now you can run ssh babylon, or pick babylon directly in VS Code.
Select the Python interpreter in VS Code (server side context)
Choose interpreter (VS Code, connected to server)
Ctrl+Shift+P → Python: Select Interpreter → pick the "hls25" conda env
Copying Files To/From the Server (scp basics)
Upload a file to the server
scp path/to/localfile.txt onid@babylon.eecs.oregonstate.edu:~
Download a file from the server
scp onid@babylon.eecs.oregonstate.edu:~/remotefile.txt .
Copy a folder recursively
scp -r path/to/localfolder onid@babylon.eecs.oregonstate.edu:~
Advanced SSH Config (Optional)
Jump host / bastion (ProxyJump)
ProxyJump example (Local Machine)
Host osu
HostName access.engr.oregonstate.edu
User onid
IdentityFile ~/.ssh/id_ed25519
Host babylon
HostName babylon.eecs.oregonstate.edu
User onid
IdentityFile ~/.ssh/id_ed25519
ProxyJump osu
Port forwarding (handy for Jupyter)
LocalForward example (Local Machine)
LocalForward 8888 localhost:8888
Other options (use with care)
Extra options (Local Machine)
Port 2222
# The following weaken security - avoid unless you understand the risks.
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
X11 forwarding (GUI apps over SSH)
X11 (Local Machine)
ssh -X onid@babylon.eecs.oregonstate.edu
# or (less strict)
ssh -Y onid@babylon.eecs.oregonstate.edu
You need a local X server (e.g., XQuartz on macOS). Many GUI tools are easier to run locally; use X11 only if required.
Recommended Python Setup: Conda (Server Side)
Why Conda (Miniforge): prebuilt packages from conda-forge reduce compiler errors and dependency issues.
Install Miniforge (Server Side)
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "$HOME/miniforge3"
"$HOME/miniforge3/bin/conda" init bash
source ~/.bashrc
Create & use the course environment (Server Side)
conda create -n hls25 python=3.11 -y
conda activate hls25
conda install numpy scipy matplotlib -y
Each login: conda activate hls25. To leave the environment: conda deactivate.
Fallback Python Setup: venv (Server Side, not recommended)
Use only if Conda cannot be used on the server.
Load Python module (Server Side; some clusters require modules)
module load python/3.11
Create & activate venv (Server Side)
python -m venv ~/hls25-venv
source ~/hls25-venv/bin/activate
pip install --upgrade pip
Deactivate venv (Server Side)
deactivate
Troubleshooting (Read top to bottom)
"Host key verification failed" or server identity changed
Clear old host keys (Local Machine)
ssh-keygen -R babylon.eecs.oregonstate.edu
"Connection closed" or cannot reach port 22
Check port reachability (Local Machine)
# Linux/macOS/WSL
nc -zv babylon.eecs.oregonstate.edu 22
# Windows PowerShell
Test-NetConnection babylon.eecs.oregonstate.edu -Port 22
Still asks for a password (keys not used)
Verify server-side permissions (Server Side)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Remove CRLF from authorized_keys (Server Side)
sed -i 's/\r$//' ~/.ssh/authorized_keys
Verbose SSH to see why it fails (Local Machine)
ssh -vvv onid@babylon.eecs.oregonstate.edu
-vvv output:"Offering public key:
~/.ssh/id_ed25519" followed by "Authentication succeeded".If you see "Permission denied (publickey)", your key wasn't accepted; recheck permissions and that the correct public key was copied.
VS Code won't connect or can't find Python
VS Code tips
1) Ensure you can SSH from a normal terminal first.
2) In VS Code (connected), Ctrl+Shift+P → Python: Select Interpreter → pick "hls25".
3) If your key has a passphrase, ensure an SSH agent is running and the key is added.
Not Recommended: MobaXterm
MobaXterm bundles SSH and X11, but for this course the supported path is:
- Windows WSL (Ubuntu) for a consistent Linux shell.
- SSH keys + VS Code Remote SSH for editing and running code on the server.
- Conda (Miniforge) to manage Python environments. This stack minimizes platform-specific issues and matches the tools used in later labs.
Quick Reference (Cheat Sheet)
One-time setup (Local Machine)
# Windows only (PowerShell as Admin)
wsl --install -d Ubuntu
# Everyone (Linux/macOS/WSL)
ssh-keygen -t ed25519 -C "onid@oregonstate.edu"
Copy key & fix perms
# Linux/macOS/WSL
ssh-copy-id -i ~/.ssh/id_ed25519.pub onid@babylon.eecs.oregonstate.edu
# Server Side
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Connect
ssh onid@babylon.eecs.oregonstate.edu
# or (with config)
ssh babylon
Conda environment (Server Side)
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh -b -p "$HOME/miniforge3"
"$HOME/miniforge3/bin/conda" init bash
source ~/.bashrc
conda create -n hls25 python=3.11 -y
conda activate hls25
