How to SSH to the Grid in Visual Studio Code
Follow these steps to properly set up SSH access to the Grid in Visual Studio Code on Windows. If you SSH to the Grid in VSCode without following these steps, your VSCode connection won't be set up properly. This will cause VSCode to use resources on the login node Warrior, even if you start an interactive job in VSCode. Any computationally intensive processes on Warrior are prohibited, and you will be warned if you're connecting this way. If you continue to run VSCode without following these steps, your processes on Warrior will be killed.
1. Generate an ED25519 SSH key
- On the Grid, generate an ED25519 SSH key by running: ssh-keygen -t ed25519
- This will create a key pair in ~/.ssh/
2. Copy your Private Key to your local windows system
a. From Warrior:
- Locate your private SSH key: ~/.ssh/id_ed25519
b. To your local windows system:
- Copy the key file to the following equivalent location, renaming zz9992 with your own AccessID: %USERPROFILE%\.ssh\id_ed25519_zz9992
3. Generate and Set Up Your SSH Config File
a. On Warrior:
- Run this command to generate an SSH configuration file: /wsu/apps/scripts/generate_windows_ssh_jump_config.sh
- This will create a file named windows_ssh_config.
b. To your local windows system:
- Copy the contents of the generated file and save it as your SSH config file: %USERPROFILE%\.ssh\config
- To protect your SSH directory, disable inherited permissions by running this command in Windows Command Prompt: icacls %USERPROFILE%\.ssh /inheritance:d
- Before running VSCode on the Grid, start a Slurm job. Check the name of the node your job is on by using this command and checking NODELIST: qme
6. Test Your SSH Connection
a. Connect to Warrior
- Open Windows Command Prompt and type: ssh warrior
- If successful, you should be logged into Warrior.
b. Connect to a Slurm Job Node
- To connect to a compute node where your Slurm job is running, replace sfx1 with the correct node name: ssh sfx1
7. Connect to the Grid Using VSCode
- Once your SSH setup is complete, you can run VSCode remotely on the Grid.
- Open VSCode on Windows.
- Press Ctrl-Shift-P.
- Type ssh in the command palette.
- Select "Connect to Host...".
- Enter the node name of your Slurm job.
Now, you can use VSCode to edit files and run code directly on the Grid!