SSH .config files for forwarding ports through gateways
If you have an SSH gateway that you go through before sshing to your work box, you can use the following setup to make it all happen in one simple line:Host gateway-nickname
HostName gateway.domain.tld
User username
ForwardAgent yes #This forwards your keysHost workmachine-nickname
User username
Hostname workmachine.internal-lan
ProxyCommand ssh gateway-nickname exec nc %h %p
And there you go, you can now type ’ssh workmachine-nickname’ and you can log in directly, and if you have pubkey-auth setup it’ll all happen magically!
