小编Cra*_*ige的帖子

SSH 反向端口转发绑定到地址

所以,我有一个脚本设置来自动打开到我的服务器的 SSH 连接,并将端口反向转发给我,以便 SSH 连接到我的家庭桌面。这个脚本一直有效,直到我迁移了服务器。

简而言之,我无法将此连接绑定到外部 IP 地址,我不确定为什么。

该脚本基本上运行这个命令(我可以确认这个带有我的值的命令在从 shell 运行时具有相同的结果):

sudo autossh -M 5114 -D 7474 -R servers_public_ip:2695:localhost:22 -i /home/user/.ssh/id_rsa2 remote@servers_public_ip

当我检查时lsof,我看到为remote用户绑定了以下连接:

sshd      27570   remote    3u  IPv4 161761      0t0  TCP servers_public_ip:22->67-213-103-227.eastlink.ca:62812 (ESTABLISHED)
sshd      27570   remote    7u  IPv6 161773      0t0  TCP ip6-localhost:5114 (LISTEN)
sshd      27570   remote    8u  IPv4 161774      0t0  TCP localhost:5114 (LISTEN)
sshd      27570   remote    9u  IPv6 161777      0t0  TCP ip6-localhost:2695 (LISTEN)
sshd      27570   remote   10u  IPv4 161778      0t0  TCP localhost:2695 (LISTEN)
Run Code Online (Sandbox Code Playgroud)

这些绑定都不在服务器的公共 ip 上,除了我与服务器的 …

ssh ssh-tunnel

2
推荐指数
2
解决办法
8239
查看次数

标签 统计

ssh ×1

ssh-tunnel ×1