我尝试使用scp将文件复制到远程服务器。
sudo scp atlassian-jira-6.4-x64.bin username@ip-adress:/
当我执行时,我收到错误:
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 a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
(fingerprint)
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/root/.ssh/known_hosts:1
RSA host key for IPADRESS has changed and you have requested strict checking.
Host key verification failed.
所以我从〜/ .ssh中删除了known_hosts文件并再次尝试了该命令。但仍有这条消息出现。除了.ssh文件夹之外,我还需要在哪里修改我的文件?
答案 0 :(得分:2)
使用终端上的known_host
编辑器编辑以下目录下的vim
文件。
vi /var/root/.ssh/known_hosts OR /root/.ssh/known_hosts
使用dd
命令删除所有行,并使用known_host
保存:wq!
文件并重新启动sshd服务。
service sshd restart
答案 1 :(得分:1)
如果问题反复出现,您可以尝试使用此方法。
将以下行添加到SSH配置文件的开头。
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
或针对特定主机
Host localhost
HostName localhost
UserKnownHostsFile=/dev/null
StrictHostKeyChecking=no