出处:http://www.xiaojb.com/archives/it/ssh-login.shtml
[xiao@xiao .ssh]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/xiao/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/xiao/.ssh/id_rsa. Your public key has been saved in /home/xiao/.ssh/id_rsa.pub. The key fingerprint is: b7:90:79:46:cb:1d:3b:a5:56:2d:09:95:e4:f2:b7:4a xiao@xiao
如果不需要密码的自动登录,在这里就不需要输入任何东西。
将生成的/home/xiao/.ssh/id_rsa.pub的内容复制到远程帐户目录下,具体是
~account/.ssh/authorized_keys,要保证authorized_keys的权限是700。
这样就可以ssh自动登录远程帐户了。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。