V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
rectafl1
V2EX  ›  Linux

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

  •  
  •   rectafl1 · 229 天前 · 990 次点击
    这是一个创建于 229 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

    shyrock
        1
    shyrock  
       229 天前
    盲猜是防火墙问题,从虚拟 IP 过来的 22 流量被拦截了。。。
    rectafl1
        2
    rectafl1  
    OP
       229 天前
    @shyrock 本机上该如何设置? iptables 打开 22 端口,ufw enable ssh 都试过,无效。。。
    FACEB00K
        3
    FACEB00K  
       229 天前
    已经换成 tailscale 了
    AirCrusher
        4
    AirCrusher  
       229 天前
    @rectafl1 不如用 iptables 把一个其他端口 forward 到 22
    rectafl1
        5
    rectafl1  
    OP
       229 天前
    @AirCrusher 不只 22 ,任何端口都无法连接。。。
    ppqqows
        6
    ppqqows  
       229 天前
    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

    然后再试试(除非你理解以上命令并能够还原防火墙当前状态,否则不要轻易使用)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2681 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:39 · PVG 18:39 · LAX 03:39 · JFK 06:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.