Given a remote host “remote1.institution.edu” that has to be accessed through a gateway host, “gateway.institution.edu”, instead of issuing a complex tunnel command like:
ssh -p 2222 email@example.com -t firstname.lastname@example.org
you can make life a lot simpler by setting up your
~/.ssh/config file to make use of the
Host gateway HostName gateway.institution.edu User username1 Port 2222 Host remote1 HostName remote1.institution.edu User username2 ProxyJump gateway
Now you can just:
and be done with it!
Best of all (and most importantly), your
scp commands are incredibly simplified as well, without requiring piping
tar’s, ssh fuse mounts, or double-copying through staging directories on the gateway:
scp hello-world.txt remote1:workspaces/projects/greetings/ scp remote1:workspaces/projects/greetings/see-you-later-alligator.txt .