[求助] zerotier 可直连,但无法 ssh

241 天前
 rectafl1

zerotier-cli peers 显示直连,ping 能通且很低。但 ssh 始终不通显示 connection refused 可能是什么原因?

已确认远程机器 22 端口打开,内网测试(不在同一个路由器下)可正常连接 ssh 。ssh 基本是默认配置,访问 ip 未做任何限制。

远程机器打开的其他任何端口的服务(非 80 ,443 )也不能连通。

1020 次点击
所在节点    Linux
6 条回复
shyrock
241 天前
盲猜是防火墙问题,从虚拟 IP 过来的 22 流量被拦截了。。。
rectafl1
241 天前
@shyrock 本机上该如何设置? iptables 打开 22 端口,ufw enable ssh 都试过,无效。。。
FACEB00K
241 天前
已经换成 tailscale 了
AirCrusher
241 天前
@rectafl1 不如用 iptables 把一个其他端口 forward 到 22
rectafl1
241 天前
@AirCrusher 不只 22 ,任何端口都无法连接。。。
ppqqows
240 天前
IPtables:
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X

nftables:
nft flush ruleset

然后再试试(除非你理解以上命令并能够还原防火墙当前状态,否则不要轻易使用)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/972612

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX