| 
                         《ssh-agent管理ssh密钥》要点: 本文介绍了ssh-agent管理ssh密钥,希望对您有用。如果有疑问,可以联系我们。 
			            ssh-agent是ssh其中一个组件,可以用来管理密钥和传送证书. 
ssh-agent的man原文 
DESCRIPTION 
     ssh-agent is a program to hold private keys used for public key authenti- 
     cation (RSA,DSA,ECDSA).  The idea is that ssh-agent is started in the 
     beginning of an X-session or a login session,and all other windows or 
     programs are started as clients to the ssh-agent program.  Through use of 
     environment variables the agent can be located and automatically used for 
     authentication when logging in to other machines using ssh(1). 
ssh-agent代理允许使用ssh登陆已经配置ssh信任关系的机器,并在这些已经配置同样信任关系的机器间跳转,而不需要再次鉴权. 
 
例如: 在不设置ssh-agent的情况下  机器bbb,ccc和ddd上都已经配置了aaa机的公钥 
从aaa机器登陆bbb后,如果需要登陆ccc或者ddd机器  就必须是先退出bbb再重新登陆ccc或者ddd 
root@aaa$ ssh bbb 
root@bbb$ ssh ccc    如果从bbb上登陆ccc,会因为没有信任关系提示要求输入密码 
root@ccc’s password:  
这就是ssh-agent要解决的问题,通过所有服务器上存放私钥副本,可以不需要暴露私钥. 
你所需要做的是在aaa上启动ssh-agent代理,然后ssh-add添加默认的ssh密钥. 
root@aaa$ ssh-agent 
SSH_AUTH_SOCK=/XXXXXXX/XXX/agent.401; export SSH_AUTH_SOCK; 
SSH_AGENT_PID=402; export SSH_AGENT_PID; 
root@aaa$ ssh-add 
不过你还需要在bbb,ccc和ddd机器上配置ssh客户端转发代理请求,配置/etc/ssh/ssh_config(不同操作系统位置不大一样) 
ForwardAgent Yes  
这样当aaa登陆bbb,然后跳转ccc的时候,bbb会要求ssh-agent提供有效证书,甚至再继续跳转倒ddd上,ccc会先和bbb协商转发请求给aaa的ssh-agent.                         (编辑:滁州站长网) 
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! 
                     |