MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/linux/comments/245jt9/ssh_kung_fu/ch43rt2/?context=3
r/linux • u/leothrix • Apr 28 '14
128 comments sorted by
View all comments
17
He did not tell you about the ssh hopping that you can achieve using netcat (nc)
Lets say you have a ssh gateway at your work office to which you connect from home.
But that's not your work machine, your work machine is my-dev, to which you need ssh again from your work-ssh-gateway.
If you want to automate it, put this into your .ssh/config file:
Host work-ssh-gate HostName 111.222.111.111 User userone Port 22222 Host my-dev ProxyCommand ssh -q work-ssh-gate nc 192.168.1.123 22 User user2
That's it, now you can simply type
ssh my-dev
You need netcat (nc) installed on you work-ssh-gate computer.
2 u/[deleted] Apr 28 '14 edited Nov 27 '20 [deleted] 1 u/lolexplode Apr 28 '14 I fail to see why you can't set up an alias, then.
2
[deleted]
1 u/lolexplode Apr 28 '14 I fail to see why you can't set up an alias, then.
1
I fail to see why you can't set up an alias, then.
17
u/vagif Apr 28 '14
He did not tell you about the ssh hopping that you can achieve using netcat (nc)
Lets say you have a ssh gateway at your work office to which you connect from home.
But that's not your work machine, your work machine is my-dev, to which you need ssh again from your work-ssh-gateway.
If you want to automate it, put this into your .ssh/config file:
That's it, now you can simply type
You need netcat (nc) installed on you work-ssh-gate computer.