ssh -oproxycommand="ssh Gateway.mycompany.com nc %h %p" WorkPC
Note: WorkPC can the internal IP address or internal host name recognized by Gateway. The host name (or ip address) of the Gateway must be public accessible.
ssh -oproxycommand="ssh Gateway.mycompany.com nc %h %p" 192.168.20.12
Note: if nc is not installed on the Gateway, you can try the following command instead:
ssh -oproxycommand="ssh Gateway.mycompany.com /bin/bash -c 'exec 3<>/dev/tcp/%h/%p; cat <&3 & cat >&3;kill $!'" WorkPC
See also:
- Multi-hop SSH using Putty
- Forward SSH traffic through a middle machine
- Multiple HOP tunnel to chain port forwarding
- nc man page
- SSH ProxyCommand without netcat
No comments:
Post a Comment