当我ping我的服务器,它响应:
Pinging 192.168.2.222 with 32 bytes of data: Reply from 192.168.2.222: bytes=32 time<1ms TTL=64 Reply from 192.168.2.222: bytes=32 time<1ms TTL=64 Reply from 192.168.2.222: bytes=32 time<1ms TTL=64 Reply from 192.168.2.222: bytes=32 time<1ms TTL=64 Ping statistics for 192.168.2.222: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
当我使用Xshell来连接服务器时,它响应,但在以下行停止:
Connecting to 192.168.2.222:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'.
Rstudio服务器正在服务器上运行,192.168.2.222:8787也不响应(始终处于连接状态)。 然后我试图用debuggingssh,它也停在最后一行:
>ssh -vvv 192.168.2.222 OpenSSH_7.1p2, OpenSSL 1.0.1g 7 Apr 2014 debug1: Reading configuration data /etc/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.2.222 [192.168.2.222] port 22. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_rsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/mobaxterm/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.1
然后我试着用其他的方法来用下面的命令行来诊断服务器:
>nc -v -w 1 192.168.2.222 22 Connection to 192.168.2.222 22 port [tcp/ssh] succeeded!
我仍然无法弄清楚发生了什么事情! 当我去服务器机房,服务器没有任何与屏幕黑色的东西。 在我手动重新启动计算机后,我可以用sshlogin计算机。 但几个小时后,问题再次发生! 我真的不知道有什么问题,我只是一个学生,对linux服务器不太了解。 运行CentOS 6.5的服务器
ssh协议/软件包可能有问题尝试重新安装或升级open-ssh服务器软件包并重新生成密钥
如何重新生成新的SSH服务器密钥
这是一个不寻常的话题,因为大多数发行版在安装OpenSSH服务器包的过程中为您创build了这些密钥。 但是,不时生成新的服务器密钥可能会很有用,当我复制包含安装的ssh软件包的虚拟专用服务器时,会发生这种情况。 如果您使用SSH1和/或SSH2协议,则OpenSSH需要不同的密钥。 所有密钥都是由ssh-keygen生成的,应该可以在你的系统上使用ssh软件包。 收据与生成自己的密钥几乎相同,只是您应该使用空的密码短语。 默认密钥长度也是适当的(rsa为2048位,dsa为1024位)
SSH1协议对于SSH1协议,需要生成一个rsa1密钥如下:ssh-keygen -q -f /etc/ssh/ssh_host_key -N“-t rsa1
SSH2协议对于SSH2协议,您需要两个密钥,一个RSA密钥和一个DSA密钥生成如下:
ssh-keygen -f / etc / ssh / ssh_host_rsa_key -N'-t rsa
ssh-keygen -f / etc / ssh / ssh_host_dsa_key -N'-t dsa
自2011年1月以来,OpenSSH也支持ECDSA密钥,您可以使用以下命令生成一个新密钥:ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N“-t ecdsa -b 521