SSH反向隧道

1,服务器A

# cat /etc/issue
Debian GNU/Linux 9 \n \l
  • vim /etc/ssh/sshd_config
#GatewayPorts no
GatewayPorts yes
/etc/init.d/ssh restart

2,公司内网B

╰─➤  cat /etc/issue                                                                                                                                                                                                                     130 ↵
Kali GNU/Linux Rolling \n \l
apt install -y autossh
  • 公司内网B 配置免密钥ssh登陆 服务器A
autossh -M 34567 -NfR 0.0.0.0:22101:localhost:22 root@公网ip

3,家里电脑测试

ssh -p 22101 root@公网ip 

参考:

  1. What Is Reverse SSH Tunneling
  2. 利用AutoSSH建立SSH隧道,实现内网穿透
  3. 使用SSH反向隧道进行内网穿透
  4. SSH反向隧道搭建过程

猜你喜欢

转载自blog.csdn.net/u010953692/article/details/108458055
今日推荐