版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Davis_Dxs/article/details/80222859
外网服务器:
IP:47.96.98.24
username: waiwang
password: 123456
系统:centos 7.3
内网服务器:
IP:192.168.3.180
username: neiwang
password: 123456
系统:centos 6.6
一、内网SSH连接外网
ssh -C -R a:b:c -p d e@f
a: 要绑定的外网端口
b: 给外网设置主机名
c: 内网ssh服务端口(22)
d: 外网ssh服务端口
e: 外网用户名
f: 外网IP
ssh -C -R 6232:remote:22 -p 22 [email protected]
二、外网ssh连接内网
ssh -C -D a -p a neiwnag@b
参数参考上面
ssh -C -D 6232 -p 6232 neiwnag@remote
输入密码 反向代理ok。
ssh -C -D 6232 -p 6232 neiwnag@remote