Skip to content

User field in SSH config

️ EDIT: Please see comments below for an even better setup

Thanks for writing this up, it's already easier to use than stat b/c of the SSH keys!

I have a custom SSH config that I'd like to share. On my local machine my username is jacob, but on W&M systems I'm jwhall. I've specified this using the SSH config file, so that I never have to enter my username, even on destination machines (like HPC servers). Here is what it looks like:

Host *.wm.edu !bastion.wm.edu
    User jwhall
    ProxyJump jwhall@bastion.wm.edu

!bastion.wm.edu prevents a jumphost loop.

Then, I can append something like this to my SSH config file to create shortcuts to servers I log into often:

Host bora
  Hostname bora.sciclone.wm.edu

Now I can just run ssh bora, and it does the rest automatically. Hope this is helpful to someone!

Edited by Jacob Hall