1、输入以下命令:ssh-keygen -t rsa
2、输入命令ls:产生两个文件:id_rsa id_rsa.pub
3、复制id_rsa.pub,并命名为authorized_key
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
4、执行ssh localhost。
验证成功:
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is 07:07:8e:1c:c0:7e:7f:1f:ca:6a:e6:d3:cb:7f:b7:a1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
本文档详细介绍了如何通过SSH密钥生成命令创建一对密钥,并将其配置到本地主机中,实现免密码登录。具体步骤包括使用ssh-keygen-trsa生成密钥对,检查生成的密钥文件,将公钥复制并重命名为authorized_keys文件。
7351

被折叠的 条评论
为什么被折叠?



