SSH 連線警示「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」

偶爾會碰到這種錯誤,但是每次都會忘記怎麼用指令去解決,又不喜歡修改 ~/.ssh/known_hosts,記錄一下解決方式

 

在透過 SSH 連線目標主機時,如果是第一次連線,會出現以下訊息,詢問是否要繼續連線:

The authenticity of host 'x230.ttc.caloskao.org (10.10.3.68)' can't be established.
ECDSA key fingerprint is SHA256:OhTNCCfw+ymd0iRXL/ZEwU9q/uJCNRKHu534yuJCxQI.
Are you sure you want to continue connecting (yes/no)?

Read more “SSH 連線警示「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」”

[FreeBSD] 開啟SSH遠端連線

修改 /etc/ssh/sshd_config

PermitRootLogin yes
PermitEmptyPasswords no
PasswordAuthentication yes

 

修改 /etc/inetd.conf,將以下的註解拿掉(開啟遠端登入root)

ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i -6

 

/etc/rc.conf 加入

sshd_enable="yes"

 

重新啟動服務

/etc/rc.d/sshd restart