Linux scp 提示"WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED" 的解決方案
註釋:
用過ssh的朋友們應該有注意到,首次透過ssh訪問新環境時都會提示“Are you sure you want to continue connecting (yes/no)?”,第二次再連線就不會有該提示;正因如下原因
ssh預設會把你每個你訪問過計算機的公鑰(public key)都記錄在/root/.ssh/known_hosts。當再次訪問該主機時,OpenSSH會校對公鑰,公鑰相同直接連線無如上提示;如果公鑰不同,OpenSSH則發出警告, 避免你受到DNS Hijack之類的攻擊。
SSH_Keys參考 (簡體中文)
報錯資訊:
[root@zabbix-server data]# scp scripts/index.html 10.240.1.14:/root
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
f0:7b:32:a5:5a:84:50:fd:2a:de:9c:e6:6e:7c:52:bb.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:15 -->行號
RSA host key for 10.240.1.14 has changed and you have requested strict checking.
Host key verification failed.
lost connection
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
f0:7b:32:a5:5a:84:50:fd:2a:de:9c:e6:6e:7c:52:bb.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:15 -->行號
RSA host key for 10.240.1.14 has changed and you have requested strict checking.
Host key verification failed.
lost connection
[root@zabbix-server data]#
原因:
遠端10.240.1.14 公鑰有改變,導致zabbix-server本地OPENSSH 校對公鑰失敗。
解決方案:
1)手動刪除 /root/.ssh/known_hosts 檔案 對應遠端IP資訊(vi /root/.ssh/known_hosts ---> 錯誤公鑰資訊 執行dd 再:wq 即可.)
2)命令刪除 ssh-keygen -R 10.240.1.14
[root@Database-backup BACKUP]# ssh-keygen -R 10.240.1.14
/root/.ssh/known_hosts updated.Original contents retained as /root/.ssh/known_hosts.old
[root@Database-backup BACKUP]#
3)配置檔案“~/.ssh/config” ,加上下面兩行來實現scp 不做known_hosts驗證,重啟伺服器。
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
** 建議方案3 SSH登陸時會忽略known_hsots檔案,不安全。
擴充套件:
檢視本地/root.ssh/known_hosts某IP公鑰資訊命令:ssh-keygen -F IP
【源於本人筆記】 若有書寫錯誤,表達錯誤,請指正...
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28602568/viewspace-1779455/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED解決方法REMIDE
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- Linux - SSH: WARNING REMOTE HOST IDENTIFICATION HAS CHANGEDLinuxREMIDE
- ssh登陸 “remote host identification has changed!“ 解決方案REMIDE
- SSH登入:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- REMOTE HOST IDENTIFICATION HAS CHANGED 問題解決REMIDE
- SSH登入警告(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)REMIDE
- ssh無法連線 WARNING REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- SSH登陸錯誤 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- linux之 ssh連線伺服器,WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!Linux伺服器REMIDE
- 解決方案: scp/ssh 的登陸提示很慢 (Linux)Linux
- ssh問題:ssh_exchange_identification: Connection closed by remote hostIDEREM
- 免密scp解決ssh_exchange_identification:read connection reset by peer 原因IDE
- 解決MySQL server has gone away錯誤的解決方案MySqlServerGo
- linux下ping: unknown host錯誤解決方案Linux
- MySQL server has gone away 解決方案MySqlServerGo
- PHP Warning: exec() has been disabled for security 問題解決辦法PHP
- 織夢提示dedecms error warning錯誤的解決方法Error
- Starting sendmial: make: Warning: File 'virtusertable.db' has ..的解決辦法2
- 安裝RAC,Actual Result: Unknown Host Exception has Occurred錯誤解決Exception
- scp時候出現ssh Connection refused的解決方案
- dbeaver 升級 24.1.x 版本提示 An error has occurred 的解決Error
- Linux的scp命令詳解Linux
- linux之cp/scp命令+scp命令詳解Linux
- SCP報錯:Host key verification failed.AI
- Mysql 錯誤日誌出現大量[Warning] Aborted connection to db user host的解決思路MySql
- Linux scp命令詳解Linux
- Oracle opatch apply 時提示oci.dll has active的解決辦法OracleAPP
- Linux Couldn’t resolve host 解決辦法Linux
- linux下scp命令詳解Linux
- linux輸入yum後提示: -bash: /usr/bin/yum: No such file or directory的解決方案Linux
- PbootCMS中常見的錯誤提示及其解決方案boot
- java.lang.IllegalStateException: getOutputStream() has already been called for this response解決方案JavaException
- scp出現錯誤的解決辦法
- Arch Linux 下的 QQ 解決方案Linux
- Linux提示crontab command not found的解決方法Linux
- QT 出現 warning: unterminated #pragma pack (push, ...) at end of file 問題的解決方案QT
- Linux下"無法執行SCP開始傳輸"解決方法Linux