You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
851 B

5 years ago
# **ssh-add**
7 years ago
6 years ago
## 说明
7 years ago
5 years ago
**ssh-add命令** 是把专用密钥添加到ssh-agent的高速缓存中。该命令位置在`/usr/bin/ssh-add`
7 years ago
5 years ago
## 选项
7 years ago
5 years ago
```markdown
7 years ago
ssh-add [-cDdLlXx] [-t life] [file ...]
ssh-add -s pkcs11
ssh-add -e pkcs11
-D删除ssh-agent中的所有密钥.
-d从ssh-agent中的删除密钥
5 years ago
-e pkcs11删除PKCS#11共享库pkcs1提供的钥匙
-s pkcs11添加PKCS#11共享库pkcs1提供的钥匙
7 years ago
-L显示ssh-agent中的公钥
-l显示ssh-agent中的密钥
-t life对加载的密钥设置超时时间超时ssh-agent将自动卸载密钥
-X对ssh-agent进行解锁
-x对ssh-agent进行加锁
```
5 years ago
## 实例
7 years ago
5 years ago
```bash
ssh-add ~/.ssh/id_dsa # 把专用密钥添加到 ssh-agent 的高速缓存中
ssh-add -d ~/.ssh/id_xxx.pub # 从ssh-agent中删除密钥
ssh-add -l # 查看ssh-agent中的密钥
7 years ago
```