In some situations (e.g. security reasons) it's necessary to log in on a SSH jumhost first and from there to the final SSH destination.
- Painful
[personal computer] ssh <user>@jumphost.example.com [jumphost] ssh <user>@sfinalhost.example.com
- Better, but still much to to type
[personal computer] ssh -J <user>@jumphost.example.com <user>@sfinalhost.example.com
- Lazy user solution:
# File `~/.ssh/config` (on personal computer):
Host jumphost
Hostname jumphost.example.com
Host finalhost
User <user>
Hostname finalhost.example.com
ProxyJump jumphost
# Just type
[personal computer] ssh finalhostTip: if a host shows anoying banner on logging, suppress it by:
$ ssh -o LogLevel=error <user>@<host> # the option can also specified in ~/.ssh/config in general LogLevel error # the option can also specified in ~/.ssh/config per host Host finalhost LogLevel error