You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Linux Mint系统下内外网SSH连接失败问题求助

Linux Mint系统下内外网SSH连接失败问题求助

各位大佬好,我最近在Linux Mint上碰到了个SSH连接的棘手问题,折腾好久都没解决,想请大家帮忙看看:

  • 不管是从外部不同网络环境连接我的本地电脑,还是在本地用 ssh [myname]@127.0.0.1 尝试连接,全都失败
  • 但用 ssh localhost 却能正常连上,完全没问题
  • 我已经在 /etc/hosts.allow 里添加了 sshd: ALL 和 ssh: ALL 两条规则,然而一点用都没有
  • 甚至把路由器的防火墙关掉了,还是没法解决

我先查了sshd的监听状态,执行 sudo ss -tulpn | grep :22 得到的输出是:

tcp     LISTEN   0        128              0.0.0.0:22             0.0.0.0:*      users:(("sshd",pid=1075,fd=4))                                                 
tcp     LISTEN   0        128                 [::]:22                [::]:*      users:(("sshd",pid=1075,fd=3))

另外我从外部网络尝试连接时,执行了 ssh -X -vvv [myname]@[my-ip-address],日志开头部分如下:

OpenSSH_8.9p1 Ubuntu-3ubuntu0.7, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /users/[myname]/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
...(后面的日志内容被截断了)

实在搞不懂为什么localhost能正常连接,但127.0.0.1和外部公网IP都连不上,有没有大佬能给我指个排查方向或者解决办法?真的太感谢了!

备注:内容来源于stack exchange,提问作者hjm_els

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 12:13:04