SSH 连接超时 Ubuntu 20.04

SSH 连接超时 Ubuntu 20.04

我查看了有关此主题的上百万个帖子,但无一奏效。我尝试通过端口 22 ssh 进入我的 Linux。连接被拒绝。

  1. UFW 处于非活动状态,并且未下载防火墙命令
  2. SSH 服务器处于活动状态并且是最新的
  3. 尝试更改 /etc/ssh/sshd_config 中的默认端口,然后重新启动 systemctl 并在 ssh 尝试中指定新端口
  4. 清除并重新安装 openssh-client openssh-server
  5. 我可以在同一个 wifi 网络上的两台 mac 机器之间来回 ssh
  6. ssh 曾经在同一客户端和同一 IP 地址下工作过,后来似乎随机停止了,从那以后就再也没有工作过。
  7. 已验证客户端正在尝试连接到当前 IP 地址。再次确认此网络上的其他计算机之间的 ssh 有效。这只是 Linux 计算机接收 ssh 请求的问题
  8. 我尝试远程访问的计算机的 ping [ip 地址] 输出输出响应,但从客户端 ping 显示请求超时
  9. 这是公司网络,所以我无法访问路由器。但同样,根据上述第 5 点和第 7 点,我排除了上游网络问题
  10. 我可以使用专有软件 (AnyDesk) 远程访问主机,没有任何问题
  11. 服务器(Ubuntu 20.04)似乎仅阻止 Mac OS 使用 ssh。在同一网络上运行的 Windows 11 的 SSH 运行正常。在 3 台不同的 Mac OS 机器上进行了尝试,所有机器都运行与服务器在同一网络上的不同版本的 Mac OS,并且每台机器上的 ssh 都超时了。

请求输出-vvv user_id@ip_address

    OpenSSH_9.0p1, LibreSSL 3.3.6
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
    debug1: /etc/ssh/ssh_config line 54: Applying options for *
    debug2: resolve_canonicalize: hostname 172.xx.xxx.16 is address
    debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/samcentanni/.ssh/known_hosts'
    debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/samcentanni/.ssh/known_hosts2'
    debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
    debug3: ssh_connect_direct: entering
    debug1: Connecting to 172.xx.xxx.16 [172.xx.xxx.16] port 22.
    debug3: set_sock_tos: set socket 3 IP_TOS 0x48
    debug1: connect to address 172.xx.xxx.16 port 22: Operation timed out
    ssh: connect to host 172.xx.xxx.16 port 22: Operation timed out

请求输出service sshd status

    ssh.service - OpenBSD Secure Shell server
         Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: e>
         Active: active (running) since Tue 2023-10-03 09:42:22 EDT; 24h ago
           Docs: man:sshd(8)
                 man:sshd_config(5)
        Process: 2475 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
       Main PID: 2535 (sshd)
          Tasks: 1 (limit: 629145)
         Memory: 2.4M
         CGroup: /system.slice/ssh.service
                 └─2535 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
Oct 03 09:42:22 user systemd[1]: Starting OpenBSD Secure Shell server...
Oct 03 09:42:22 user sshd[2535]: Server listening on 0.0.0.0 port 22.
Oct 03 09:42:22 user sshd[2535]: Server listening on :: port 22.
Oct 03 09:42:22 user systemd[1]: Started OpenBSD Secure Shell server.
Oct 03 09:42:22 user sshd[2788]: Unable to negotiate with 127.0.0.1 port 56816: no matching host key type found. Their offer: ssh-dss [preauth]
Oct 03 09:42:22 user sshd[2789]: Connection closed by 127.0.0.1 port 56824 [preauth]
Oct 03 09:42:22 user sshd[2790]: Connection closed by 127.0.0.1 port 56834 [preauth]
Oct 03 09:42:22 user sshd[2792]: Connection closed by 127.0.0.1 port 56836 [preauth]
Oct 03 09:42:22 user sshd[2794]: Unable to negotiate with 127.0.0.1 port 56842: no matching host key type found. Their offer: [email protected] [preauth]
Oct 03 09:42:22 user sshd[2795]: Unable to negotiate with 127.0.0.1 port 56844: no matching host key type found. Their offer: [email protected] [preauth]

相关内容