您的位置:首页 > 其它

ssh证书认证登陆

2011-02-22 20:21 246 查看
服务器与服务器进行scp,备份时都需要密码的认证造成了很多不便,以及安全的隐患,利用ssh的证书认证可以方便的进行备份与拷贝,提高了安全性能。方法如下: 在服务器A上:创建密钥[root@localhost ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
然后进行scp id_rsa.pub ip:.ssh/authorized_keys拷贝到服务器B上,然后再服务器B上重复A的操作即完成双向认证。注:如果没有root下没有.ssh请建立一个即可。本文出自 “mcshell学习博客” 博客,请务必保留此出处http://mcshell.blog.51cto.com/803455/498468
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: