环境centos7两台

跳板机: eth0:X.X.X.X

     eth1:10.165.93.161

内网主机:eth0:10.165.93.162


wKiom1g1Un_zGiheAADP-lLzWMU142.jpg-wh_50

ssh -4fg -L 2222:10.165.93.162:22 -N localhost

解析:

-4  以ipv4地址格式

-f  后台运行

-g  允许远程主机进行连接本地端口2222

-L [bind_address:]port:host:hostport

-N  Do not execute a remote command.  This is useful for just for-

             warding ports (protocol version 2 only).

ssh x.x.x.x:2222  即可登录内网主机