我已经重新启动了Fedora 25服务器,因为没有重新启动它3天(我已经安装的唯一两件事是JRE和屏幕),并注意到SSH停止工作。 有时连接重置,有时closures。
sh-3.2# ssh [email protected] Connection reset by 192.168.1.127
我不知道如何查看我的日志,因为现在我不再拥有ssh访问权限,但是如果使用ssh -vvv(我不确定OS X El Capitan输出的是多lessLinux)
sh-3.2# ssh -vvv [email protected] OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: /etc/ssh/ssh_config line 56: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.1.127 [192.168.1.127] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.9 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4 debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000 debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to 192.168.1.127:22 as 'root' debug3: hostkeys_foreach: reading file "/var/root/.ssh/known_hosts" debug1: SSH2_MSG_KEXINIT sent Connection reset by 192.168.1.127 sh-3.2#
我通常使用公钥连接,但是使用公钥并不会改变上面的输出。 Nginx仍然完全与Cockpit一起工作,networking方面没有任何改变。 如果我尝试将自己的服务器连接到自己的服务器上,则不会再有任何变化 (我知道总是使用root是不安全的,但我已经尝试了一切)
[root@localhost ~]# ssh -vvvv localhost OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 56: Including file /etc/ssh/ssh_config.d/05-red hat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 2: include /etc/crypto-policie s/back-ends/openssh.config matched no files debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for * debug2: resolving "localhost" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to localhost [::1] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.4 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4 debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000 debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to localhost:22 as 'root' debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts" debug3: send packet: type 20 debug1: SSH2_MSG_KEXINIT sent Connection reset by ::1 port 22 [root@localhost ~]# ^C
此外,我的networking上没有其他设备可以连接。 我没有试过PuTTY,但Cyberduck只是告诉我,“recv失败”。 我注意到连接总是在“SSH2_MSG_KEXINIT”被发送后重置,但我不知道它是什么。
这里是我的SSHconfiguration,所有这些都评论:
[root@localhost ~]# cat /etc/ssh/ssh_config # $OpenBSD: ssh_config,v 1.30 2016/02/20 23:06:23 sobrado Exp $ # Host * # ForwardAgent no # ForwardX11 no # RhostsRSAAuthentication no # ConnectTimeout 0 # StrictHostKeyChecking ask # IdentityFile ~/.ssh/identity # IdentityFile ~/.ssh/id_rsa # IdentityFile ~/.ssh/id_dsa # IdentityFile ~/.ssh/id_ecdsa # IdentityFile ~/.ssh/id_ed25519 # Port 22 # Protocol 2 # Cipher 3des # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3d es-cbc # MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160 # EscapeChar ~ # Tunnel no # TunnelDevice any:any # PermitLocalCommand no # VisualHostKey no # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # # To modify the system-wide ssh configuration, create a *.conf file under # /etc/ssh/ssh_config.d/ which will be automatically included below Include /etc/ssh/ssh_config.d/*.conf
我试过DNF重新安装openssh服务器,并没有改变任何东西。 我不确定,但是正如我所说的,我不确定如何在Fedora 25中查看OpenSSH的日志文件(我是否有正确的日志?)。如果可以修复因为它阻止了我工作4个小时。 谢谢。
好的。 所以,通过systemctl restart sshd不起作用。 不过,我曾经build议使用# /sbin/sshd来启动OpenSSH。 它出人意料地工作,一切都在重新启动之前function。 我不明白为什么。 可能是一个权限问题。 我不知道肯定,但“对等重置连接”错误似乎是最难debugging之一。