Skip to content

Instantly share code, notes, and snippets.

@probablytom
Last active November 20, 2017 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save probablytom/49956308756449389d273ab7e3f1fddf to your computer and use it in GitHub Desktop.
Save probablytom/49956308756449389d273ab7e3f1fddf to your computer and use it in GitHub Desktop.
Easy ssh to SAND

Getting easy ssh

Take the below configuration, edit in your username for both entries, and copy it into ~/.ssh/config on your local machine.

When you want to access sibu, try:

ssh sibu

And when you want to access sand, try:

ssh sand

That's you! SSHing into sand no longer requires hacking around with sibu manually. Easy.

Making it easier

It can get easier yet: you can get slippery delicious passwordless access, too.

Make sure you have ssh keys

Enter cat ~/.ssh/id_rsa.pub — if nothing gets printed, run ssh_keygen, and hit enter at any prompts.

Copy the key over

Run cat ~/.ssh/id_rsa.pub and copy it.

Run ssh sibu and then nano ~/.ssh/authorized_keys (or whatever your editor of choice is). Paste onto a new line. Save.

You should now have passwordless access to both sibu and sand!

 Host sibu
Hostname sibu.dcs.gla.ac.uk
User YOURUSERNAME
Host sand
ProxyCommand ssh sibu nc -w 90 %h %p
ServerAliveInterval 30
StrictHostKeyChecking no
User YOURUSERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment