Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
rectafl1
V2EX  ›  Linux

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

  •  
  •   rectafl1 · Sep 11, 2023 · 3008 views
    This topic created in 1153 days ago, the information mentioned may be changed or developed.

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

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

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

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

    然后再试试(除非你理解以上命令并能够还原防火墙当前状态,否则不要轻易使用)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1233 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 16:41 · PVG 00:41 · LAX 08:41 · JFK 11:41
    ♥ Do have faith in what you're doing.