1 | ssh-agent
|
2 | ===
|
3 |
|
4 | ssh密钥管理器
|
5 |
|
6 | ## 补充说明
|
7 |
|
8 | **ssh-agent命令** 是一种控制用来保存公钥身份验证所使用的私钥的程序。ssh-agent在X会话或登录会话之初启动,所有其他窗口或程序则以客户端程序的身份启动并加入到ssh-agent程序中。通过使用环境变量,可定位代理并在登录到其他使用ssh机器上时使用代理自动进行身份验证。
|
9 |
|
10 | 其实ssh-agent就是一个密钥管理器,运行ssh-agent以后,使用ssh-add将私钥交给ssh-agent保管,其他程序需要身份验证的时候可以将验证申请交给ssh-agent来完成整个认证过程。
|
11 |
|
12 | ### 语法
|
13 |
|
14 | ```shell
|
15 | ssh-agent [-c | -s] [-d] [-a bind_address] [-t life] [command [arg ...]]
|
16 | ssh-agent [-c | -s] -k
|
17 | ```
|
18 |
|
19 | ### 选项
|
20 |
|
21 | ```shell
|
22 | -a bind_address:bind the agent to the UNIX-domain socket bind_address.
|
23 | -c:生成C-shell风格的命令输出。
|
24 | -d:调试模式。
|
25 | -k:把ssh-agent进程杀掉。
|
26 | -s:生成Bourne shell 风格的命令输出。
|
27 | -t life:设置默认值添加到代理人的身份最大寿命。
|
28 | ```
|
29 |
|
30 | ### 实例
|
31 |
|
32 | 运行ssh-agent:
|
33 |
|
34 | ```shell
|
35 | ssh-agent
|
36 | ```
|
37 |
|
38 | 运行ssh-agent,它会打印出来它使用的环境和变量。
|
39 |
|
40 |
|