环境centos7两台
跳板机: eth0:X.X.X.X
eth1:10.165.93.161
内网主机:eth0:10.165.93.162
1
|
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).
1
|
ssh
x.x.x.x:2222 即可登录内网主机
|
本文转自 yanconggod 51CTO博客,原文链接:http://blog.51cto.com/yanconggod/1875862