SSH的一些稀奇古怪的報錯

購買雲服務器時候手滑不小心選擇了centos系統,尷尬,後面的一系列教程都沒法自動化運行啦,偏偏前面還已經把這個雲服務器給一些朋友用了幾天,亡羊補牢的把雲服務器重啓,重新安裝系統,這個時候雲服務器的好處就凸顯出來了,重新安裝系統的過程全自動化,我只需要鼠標點點點~

IP不變但是系統變了

但是重置好系統,重新批量新建用戶後,大家反饋無法ssh登陸,報錯如下:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
69:f4:b3:d8:32:5a:53:e7:e7:f7:ab:74:7b:92:1d:16.
Please contact your system administrator.
Add correct host key in /home/jianmingzeng/.ssh/known_hosts to get rid of this message.
Offending key in /home/jianmingzeng/.ssh/known_hosts:17
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
Agent forwarding is disabled to avoid man-in-the-middle attacks.
X11 forwarding is disabled to avoid man-in-the-middle attacks.
Permission denied (publickey,password).

很漂亮的一個報錯信息!!!

這次我沒有去谷歌搜索就想到了解決方法,很明顯報錯解釋的很清楚,是我的 /home/jianmingzeng/.ssh/known_hosts 文件裏面之前記錄的雲服務器指紋跟現在的指紋變動了,但是重新安裝系統只是把系統指紋變動了,並沒有變化IP,而文件記錄的是IP對應指紋,所以只需要刪除那一條記錄即可。

但是問題來了,每個人都需要在自己筆記本上面刪除自己的.ssh/known_hosts 文件,也是麻煩,不知道有沒有更好的解決方案呢?

內網拷貝之痛

解決了這個問題,發現還不夠,有學員又反饋 內網的scp命令出錯,因爲兩臺雲服務都是在騰訊雲,所以內網拷貝速度可以達到 100M/s ,報錯如下:

/etc/ssh/ssh_config: line 20: Bad configuration option: clientaliveinterval
/etc/ssh/ssh_config: line 21: Bad configuration option: clientalivecountmax
/etc/ssh/ssh_config: terminating, 2 bad configuration options
lost connection 

很明顯,根據提示,是我之前操作ssh聯網問題的時候不小心改錯了文件,但是沒有修改回去。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章