我无法使用公共密钥身份验证从终端登录到VPS上的干净Centos8安装。
登录时似乎已通过身份验证,但超时后返回“通过[远程主机ip地址]重置连接”(不是对等)。
我已经检查了所有日志。但实际上什么都没发生。
我已签出的内容:
我尝试从LAN中的其他计算机登录失败,但没有成功:
值得注意的是,我从同一VPS登录到干净的CentOS7安装没有任何问题。
我不知道OpenSSH 8中有什么变化吗?
我已经附上了用于登录CentOS7和CentOS8系统的详细输出:
如您所见,认证在两种方法中均成功完成:
debug1: Authentication succeeded (publickey)
我在CentOS 8中看到的主要区别是它现在使用的是OpenSSH 8,而不是OpenSSH 7。
我不知道OpenSSH 8中有什么变化吗?
提前谢谢大家。
编辑1
@thehostingadmin我不知道如何从Web GUI复制n粘贴,但这是您提供的命令的输出:https : //imgur.com/9WQJGuN
编辑2
# sysctl -w net.ipv4.tcp_tw_recycle=0
sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory
# sysctl -w net.ipv4.tcp_tw_reuse=0
net.ipv4.tcp_tw_reuse = 0
结果:仍然没有骰子
编辑3
成功/失败矩阵
| OS | SSH Client | Network | Auth | Success |
|--------------------|---------------|--------------|------|------------|
| Ubuntu 18.04 (WSL) | OpenSSH_7.6p1 | LAN (NAT x2) | OK | E01 | TO/H |
| Debian 10 (RPi) | OpenSSH_7.9p1 | LAN (NAT x2) | OK | TO/H |
| Ubuntu 18.04 | OpenSSH_7.6p1 | LAN (NAT x1) | OK | E02 |
| CentOS 7.8 | OpenSSH_7.4p1 | LAN (NAT x1) | OK | TO/H |
| CentOS 7.8 | OpenSSH_7.4p1 | VPS | OK | OK |
E01
:通过[远程主机IP地址]端口22重置连接E02
:packet_write_wait:连接到[远程主机ip地址]端口22:管道断开TO/H
:超时/挂起编辑4进行了以下更改:
# /etc/ssh/sshd_config
TCPKeepAlive yes
ClientAliveInterval 20
ClientAliveCountMax 5
没有可测量的差异。
编辑5
当ssh客户端抛出error时E01
,我可以在服务器上看到以下内容:
# journalctl -u systemd-logind -fn0
Aug 27 14:51:18 host systemd-logind[701]: New session 136 of user root.
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 1
Aug 27 14:51:38 host systemd-logind[701]: Session 136 logged out. Waiting for processes to exit.
Aug 27 14:51:38 host systemd-logind[701]: Removed session 136.
成功登录如下所示:
Aug 27 15:04:42 host systemd-logind[701]: New session 143 of user root.
编辑6
我转过身LogLevel
来DEBUG3
,发现在以下/var/log/secure
# Login Fail
Aug 27 15:59:07 host sshd[9387]: debug3: monitor_read: checking request 124
Aug 27 15:59:26 host sshd[9389]: Read error from remote host <wan ip> port 2611: Connection reset by peer
Aug 27 15:59:26 host sshd[9389]: debug1: do_cleanup
# Login Success
Aug 27 15:57:48 host sshd[9360]: debug3: monitor_read: checking request 124
编辑7
对@ fra-san表示歉意。添加更多详细的日志记录(-vvv
)确实提供了更多详细信息
# SSH fail
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: send packet: type 1
Connection reset by <remote host ip> port 22
# SSH Success
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Activate the web console with: systemctl enable --now cockpit.socket
编辑8
用ISP提供的路由器切换出我的家用路由器(自定义固件)。仍然没有喜悦。
编辑9
涉入wireshark数据包跟踪。
注意:向托管服务提供商提出问题(适用于他们)后,服务器上的OpenSSH服务器已切换到OpenSSH 7.8-但问题仍然存在。
编辑10
Wireshark。客户端与服务器:https://imgur.com/fIVbEqq
笔记
openssh
回v8我有个好消息。
我向ISP提出了一个问题。他们给我颁发了新的IP。我不知道他们还做了什么,但是已经解决了这个问题。
我还提出了与Redhat开发人员合作的问题openssh
。
他们说这是一个已知问题,尤其是在VMWare社区中:
https://communities.vmware.com/thread/590825
该问题与OpenSSH_7.8中与该QoS
标志有关的更改有关。
http://www.openssh.com/txt/release-7.8
该解决方法是使用下面的在你的~/.ssh/config
文件
Host *
IPQoS=throughput
在我确认它可以正常工作之前,我不会将其标记为答案。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句