Skip to main content

Windows SSH

Here’s a cleaner Markdown version with normal headings and code blocks (no weird inline IDs), suitable for BookStack or a README.

# Windows SSH with X Forwarding

This guide explains how to connect to the GRIT HPC system from Windows using SSH with X11 forwarding so graphical applications can display on your local machine. --- ## 1. Install Xmingan viaX aServer command(Xming) promptInstall /**Xming** winget:

using
`winget`.

Open **Command Prompt** or **PowerShell** and run:

```bash
winget install Xming

After installationinstallation, completesstart setXming anfrom the Start Menu.


2. Configure the DISPLAY Variable

Set the DISPLAY environment variable to map theso remote desktopX11 applications know where to thesend localtheir desktop:output.

Run:

setx DISPLAY localhost:0

Now closeClose and reopen your terminal after running this command so the terminal.environment Youvariable shouldtakes noweffect.

be
able

3. Set Up SSH Key Authentication (Recommended)

Using SSH keys avoids typing your password every time and is more secure.

Generate an SSH Key

Open PowerShell and run:

ssh-keygen -t ed25519

Press Enter to forwardaccept the default file location:

C:\Users\<username>\.ssh\id_ed25519

You may optionally set a remotepassphrase.

x
session

Copy viathe Key to the HPC System

If ssh-copy-id is available:

ssh-copy-id [netid]@hpc.grit.ucsb.edu

If it is not available on Windows, run:

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh [netid]@hpc.grit.ucsb.edu "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Ensure the permissions on the HPC system are correct:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

4. Connect to yourthe windowsHPC system:System

Connect with X11 forwarding enabled:

ssh -Y [netid]@hpc.grit.ucsb.edu

The -Y flag enables trusted X11 forwarding, allowing graphical applications to display on your Windows desktop.


5. Test X Forwarding

After connecting, test with a simple X application:

xclock