浅谈SSH(2)之SSH的使用

本文发布时间: 2019-Mar-21
如何用SSH登录到远程主机呢,当你第一次使用SSH登录远程主机时,会出现没有找到主机密钥的提示信息。输入"yes"后,系统会将远程主机的密钥加入到你的主目录下的 .ssh/hostkeys下,这样你就可以继续操作了。示例如下:localhost$ ssh -l yeslab remotehost.example.comHost key not found from database.Key fingerprint:xabie-dezbc-manud-bartd-satsy-limit-nexiu-jambl-title-jarde-tuxumYou can get a public key‘s fingerprint by running % ssh-keygen -F publickey.pub on the keyfile.Are you sure you want to continue connecting (yes/no)? YesHost key saved to/home/yeslab/.ssh2/hostkeys/key_22_remotehost.example.com.pubhost key for remotehost.example.com,accepted by yeslab Mon Aug 27 2012 10:20:30 -0700 [email protected] password: remotehost.example.com$因为远程主机的密钥已经加入到ssh客户端的已知主机列表中,当你第二次登陆远程主机时,只需要你输入远程主机的登录密码即可。localhost$ ssh -l yeslab [email protected] password:remotehost.example.com$由于各种原因,可能在你第一次登陆远程主机后,该主机的密钥发生改变,你将会看到一些警告信息。出现这种情况,可能有两个原因:1.系统管理员在远程主机上升级或者重新安装了SSH服务器2.有人在进行一些恶意行为等等。在你输入“yes”之前最好与管理员协商好,到底是什么原因导致出现主机验证码改变的信息,核对主机验证码是否正确。localhost$ ssh -l yeslab remotehost.example.com @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ WARNING: HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!Someone could be eavesdropping on you rightnow (man-in-the-middle attack)!It is also possible that the host key has just been changed.Please contact your system administrator.Add correct host key to ―/home/yeslab/.ssh2/hostkeys/key_22_remotehost.example.com.pub‖ to get rid of this message.Received server key's fingerprint:xabie-dezbc-manud-bartd-satsy-limit-nexiu-jambl-title-arde-tuxumYou can get a public key's fingerprint by running % ssh-keygen -F publickey.pub on the keyfile.Agent forwarding is disabled to avoid attacks by corrupted servers.Are you sure you want to continue connecting (yes/no)? yesDo you want to change the host key on disk (yes/no)? yesAgent forwarding re-enabled.Host key saved to /home/yeslab/.ssh2/hostkeys/key_22_remotehost.example.com.pub host key for remotehost.example.com,accepted by yeslabMon Aug 27 2012 10:20:50 -0700 yeslab @remotehost.example.com's password: remotehost$下一篇:浅谈SSH(3)之SSH登陆测试 http:///os/html/201209/3308.html


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:08pm
栏目列表