xshell开启ssh端口转发,通过公网机器访问内网机器

一、开启ssh转发 配置1:[root@ecs ~]#vi /etc/ssh/sshd_config修改内容:AllowTcpForwarding yes

一、开启ssh转发

配置1:
[root@ecs ~]#vi /etc/ssh/sshd_config修改内容:
AllowTcpForwarding yes
GatewayPorts yes生效:
[root@ecs ~]#/etc/rc.d/init.d/sshd restart配置2:
[root@ecs ~]vi /etc/sysctl.conf修改内容:
net.ipv4.ip_forward = 1生效:
[root@ecs ~]sudo sysctl -p 或 /sbin/sysctl -e -p /etc/sysctl.conf 

二、配置公网服务器代理

三、配置内网服务器

 四、结果

五、开启内网服务器隧道

 

 

 六、外面电脑访问内网电脑服务