导航栏: 首页 评论列表

转载: ssh-add命令

默认分类 2013-06-17 10:57:06

原文地址 http://www.lampblog.net/ubuntu/ssh-add%E5%91%BD%E4%BB%A4/

1.功能作用

把专用密钥添加到 ssh-agent 的高速缓存中

2.位置

/usr/bin/ssh-add

3.格式用法

ssh-add [-cDdLlXx] [-t life] [file ...]
ssh-add -s pkcs11
ssh-add -e pkcs11`

4.主要参数

-c      Indicates that added identities should be subject to confirmation
         before being used for authentication.  Confirmation is performed
         by the SSH_ASKPASS program mentioned below.  Successful confirma‐
         tion is signaled by a zero exit status from the SSH_ASKPASS pro‐
         gram, rather than text entered into the requester.

 -D      删除ssh-agent中的所有密钥.
 -d      从ssh-agent中的删除密钥
 -e pkcs11
         删除PKCS#11共享库pkcs1提供的钥匙。
 -s pkcs11
         添加PKCS#11共享库pkcs1提供的钥匙。
 -L      显示ssh-agent中的公钥
 -l      显示ssh-agent中的密钥 
 -t life
         对加载的密钥设置超时时间,超时ssh-agent将自动卸载密钥
 -X      对ssh-agent进行解锁
 -x      对ssh-agent进行加锁

5.应用实例

1、把专用密钥添加到 ssh-agent 的高速缓存中

ssh-add ~/.ssh/id_dsa

2、从ssh-agent中删除密钥

ssh-add -d ~/.ssh/id_xxx.pub

3、查看ssh-agent中的密钥

ssh-add -l


>> 留言评论