ssh_exchange_identification: Connection closed by remote host

使用SCP复制一个文件报如此错

[highgo@node1 hgdb]$ scp data.tar highgo@node2:/usr/local/cluster/hgdb/
ssh_exchange_identification: Connection closed by remote host
lost connection

查看ssh连接情况

[highgo@node1 hgdb]$ ssh node2 date
ssh_exchange_identification: Connection closed by remote host

查看NODE2

[root@node2 ~]# su - aaa
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied

检查/dev/null

[root@node2 ~]# ll /dev/null
ls: cannot access /dev/null: No such file or directory

对比node1

[root@node1 ~]# ll /dev/null
crw-rw-rw- 1 root root 1, 3 Dec 19 07:05 /dev/null

重建节点2的/dev/null

[root@node2 ~]# rm -rf /dev/null && mknod -m 0666 /dev/null c 1 3
You have new mail in /var/spool/mail/root
[root@node2 ~]# ll /dev/null
crw-rw-rw- 1 root root 1, 3 Dec 19 07:32 /dev/null

此时依然不行

[highgo@node2 ~]$ ssh node1 date
Host key verification failed.

删掉.ssh路径下所有文件重新配置ssh互信,无效

检查tty,pty

[root@node2 .ssh]# ll /dev/tty
ls: cannot access /dev/tty: No such file or directory
[root@node2 .ssh]# ll /dev/pty
ls: cannot access /dev/pty: No such file or directory

创建

[root@node2 .ssh]# /sbin/MAKEDEV pty
[root@node2 .ssh]# /sbin/MAKEDEV tty

测试

[root@node2 .ssh]# ssh node1 date
The authenticity of host 'node1 (192.168.56.120)' can't be established.
RSA key fingerprint is be:77:2a:67:00:85:7a:19:73:8c:48:5f:c5:95:ae:ee.
Are you sure you want to continue connecting (yes/no)?

搞定




你可能感兴趣的:(ssh_exchange_identification: Connection closed by remote host)