大网数据广告活动
服务器运维问答

ssh and Offending key for IP in /root/.ssh/known_hosts

· 52CE 我爱测

Why or why am I getting this error on server A trying to connect to server B????? ssh [email omitted] Warning: the ECDSA host key for 'zk.111.sf.development.cloudera.fu.com' differs from the key for the IP address '107.170.xxx.xx…

问题原文

原帖链接 · Tampa · CC BY-SA 3.0

Why or why am I getting this error on server A trying to connect to server B?????

ssh [email omitted]
Warning: the ECDSA host key for 'zk.111.sf.development.cloudera.fu.com' differs from the key for the IP address '107.170.xxx.xxx'
Offending key for IP in /root/.ssh/known_hosts:4
Matching host key in /root/.ssh/known_hosts:5
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
enter code here

On server A I do this

eval `ssh-agent -s`
ssh-keyscan 107.170.xxx.xxx | tee -a /root/.ssh/known_hosts

Then I try and ssh. Wow..both servers event have the same pub and private keys. I am trying to set passwordless auth between servers.

已采纳解答

原帖链接 · Vinícius Ferrão · CC BY-SA 3.0

It appears that some of your hosts have changed IP's recently and you've connected to them after and before the IP changes.

I would recommend you to cleanup your known_hosts file in the lines 4 and 5 to get rid of this error message.

Another thing to consider is: if you only want Server A connecting to Server B you just need to drop the Server A Public Key (the contents of id_dsa.pub or id_rsa.pub) in /root/.ssh/authorized_keys of Server B.

If you do want bidirectional connection you should do the same procedure for Server B to A.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-04-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。