我与ssh有一个奇怪的问题。 我正在得到一个
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
每次我连接到服务器。 然后我清除了known_hosts文件并再次连接。 2到3分钟后,我再次访问服务器, WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! 再次来了。 连接后ssh连接会自动中止。 我相信我的IP和SSH密钥不会改变。 我检查了服务器,id_rsa和id_rsa.pub键都没有改变。 我的服务器也变得非常慢。 此外,我调整了我的服务器对同步攻击,仍然没有结果。 谁能帮我?
问题依然存在。 托pipe公司告诉我,networking没有任何问题。 当由于这个奇怪的问题而终止ssh连接时,实际上用户不会注销。 当我使用ssh进入一个新的会话时,我可以看到旧的用户仍然通过键入W命令login。 如果这个用户也断开连接,当我重新login,我可以看到3个用户在里面,意味着用户不会被注销。
这些是服务器断开连接时的日志
Jul 31 10:28:33 cl-t229-203cl sshd[2082]: debug1: Forked child 6551. Jul 31 10:28:33 cl-t229-203cl sshd[6551]: Set /proc/self/oom_score_adj to 0 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: inetd sockets after dupping: 3, 3 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: Connection from 173.45.65.243 port 56944 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: Client protocol version 2.0; client software version OpenSSH_5.3 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: match: OpenSSH_5.3 pat OpenSSH* Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: Enabling compatibility mode for protocol 2.0 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: Local version string SSH-2.0-OpenSSH_5.3 Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: permanently_set_uid: 74/74 Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: list_hostkey_types: ssh-rsa Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_KEXINIT sent Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_KEXINIT received Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: kex: client->server aes128-ctr hmac-md5 none Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: kex: server->client aes128-ctr hmac-md5 none Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_NEWKEYS sent Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: expecting SSH2_MSG_NEWKEYS Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: SSH2_MSG_NEWKEYS received Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: KEX done Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: userauth-request for user root service ssh-connection method none Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: attempt 0 failures 0 Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: PAM: initializing for "root" Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: PAM: setting PAM_RHOST to "173.45.65.243" Jul 31 10:28:33 cl-t229-203cl sshd[6551]: debug1: PAM: setting PAM_TTY to "ssh" Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: userauth-request for user root service ssh-connection method keyboard-interactive Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: attempt 1 failures 0 Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: keyboard-interactive devs Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: auth2_challenge: user=root devs= Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: kbdint_alloc: devices 'pam' Jul 31 10:28:33 cl-t229-203cl sshd[6552]: debug1: auth2_challenge_start: trying authentication method 'pam' Jul 31 10:28:33 cl-t229-203cl sshd[6552]: Postponed keyboard-interactive for root from 173.45.65.243 port 56944 ssh2
断开连接(TCPstreamasynchronous同步)和密钥更改的结合非常强烈地表明你有两台具有相同IP地址的设备。 这台服务器在你的局域网上,还是你通过路由器访问的东西?
编辑:我肯定会提出与托pipe公司。 可能有人误解了地址分配,或者在/etc/sysconfig/network-scripts/ifcfg-eth0 (或OS等效文件)中存在拼写错误,或者托pipe公司已经塞满了文件。 但是直到你和他们谈话,你才会知道。
如果服务器是本地的,你可以查看你的ARPcaching,看看服务器的MAC地址在每次丢失后是否改变。 但是由于它很遥远,他们也必须为你做这个。