SCP: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

今天通过 scp 拷文件时出现以下ERROR, 根据提示信息可能是出于安全方面原因,密钥发生改变。

报错信息

连接丢失,报错信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[postgres@skytf](mailto:postgres@skytf)-> scp *.ddl [postgres@192.168.1.35:/pgdata/uims_ppa/1921/data05/pg_bakcup](mailto:postgres@192.168.1.35:/pgdata/uims_ppa/1921/data05/pg_bakcup)  
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
d3:94:17:c4:69:6f:28:5e:8e:a9:88:0d:88:f4:5e:df.
Please contact your system administrator.
Add correct host key in /home/postgres/.ssh/known_hosts to get rid of this message.
Offending key in /home/postgres/.ssh/known_hosts:2
RSA host key for 192.168.1.35 has changed and you have requested strict checking.
Host key verification failed.
lost connection

解决方法

解决方法比较简单,只要删除ssh client 端文件 ~/.ssh/known_hosts 中对应记录信息即可。

1
2
3
4
5
6
7
8
9
10
[postgres@skytf](mailto:postgres@skytf)-> cd ~/.ssh  
[postgres@skytf](mailto:postgres@skytf)-> pwd
/home/postgres/.ssh
[postgres@skytf](mailto:postgres@skytf)-> ll
total 20K
-r-------- 1 postgres postgres 668 Jul 4 2011 id_dsa
-r-------- 1 postgres postgres 642 Jul 4 2011 id_dsa.pub
-r-------- 1 postgres postgres 1.7K Jul 4 2011 id_rsa
-r-------- 1 postgres postgres 434 Jul 4 2011 id_rsa.pub
-rw------- 1 postgres postgres 1.6K Mar 26 13:44 known_hosts

修改文件 known_hosts,删除对应IP记录信息即可。

1
2
3
4
5
192.168.1.35 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Xhr9XQXTLXp+61nQRelAsms1SDbZH31QX  
u+wK/fUNCGVgxXoqwIq/tf8Cg+MgJlVRvLb3HHGK5nTGFnda/b49ITVi/TCOwEurzTIjMRm+RpDOzMWEvZN
SeNIOixcExi52D9Q3U1zebMG1U5ecxmzkvZMnwdOQpFvf9d1bGPbRY3+cn2i9yZr/ccJqTms+QMImV0VK35
QOFIxHuDTLltkowewd8AuIwCytT+k7UqP7Pe+NYzWK5bReKJuvrQheGjmEpVD3uXoqyMRfl/SuDnUXFWIyP
yfFO9NhHFT9NwM0GpiSyhCrS/oft5Ou+nmwpazYWYg0NAcMMjP1XjLOt38w==

备注:删除这条信息,重新 COPY 文件后不再报上述信息。

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/237838.html

(0)
上一篇 2022年1月29日
下一篇 2022年1月29日

相关推荐

发表回复

登录后才能评论