作用 当输入后,主机会向当前主机发送身份公钥,并保存此公钥到~/.ssh/know_hosts 如果身份验证改变,拒绝连接会出现以下效果 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ECDSA key sent by the remote host is SHA256:qFJoGa0HY3fBnHaMwCBhq5d017at0BcRdOJ3kULqrDM. Please contact your system administrator. Add correct host key in /root/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /root/.ssh/known_hosts:1 ECDSA host key for 172.25.254.4has changed and you have requested strict checking.
Generating public/private rsa key pair. Enter file in which to save the key (/home/linux/.ssh/id_rsa): ##输入保存密钥文件 Enter passphrase (empty for no passphrase): ##密钥密码 Enter same passphrase again: ##确认密码 Your identification has been saved in /home/linux/.ssh/id_rsa.##私钥 Your public key has been saved in /home/linux/.ssh/id_rsa.pub.##公钥 The key fingerprint is: SHA256:rrbJoCb/f+7m5KwEOj2+M2NaCFAg6kxyOuuB+c3kmi8 linux@westos_student5.westos.org The key’s randomart image is: ±–[RSA 3072]----+ |o… | |o. | |+… | |*o | |+o . S | |.= + . . | |+.+ * . o | |o.E@==.o | | =BBOBBO | ±—[SHA256]-----+ 方法二:ssh-keygen -f /root/.ssh/id_rsa -P “”