[17138] | 1 | SSH-AGENT(1) System General Commands Manual SSH-AGENT(1) |
---|
[16800] | 2 | |
---|
| 3 | NAME |
---|
| 4 | ssh-agent - authentication agent |
---|
| 5 | |
---|
| 6 | SYNOPSIS |
---|
| 7 | ssh-agent [-c | -s] [-d] [command [args ...]] |
---|
| 8 | ssh-agent [-c | -s] -k |
---|
| 9 | |
---|
| 10 | DESCRIPTION |
---|
| 11 | ssh-agent is a program to hold private keys used for public key authentiM-- |
---|
| 12 | cation (RSA, DSA). The idea is that ssh-agent is started in the beginM-- |
---|
| 13 | ning of an X-session or a login session, and all other windows or proM-- |
---|
| 14 | grams are started as clients to the ssh-agent program. Through use of |
---|
| 15 | environment variables the agent can be located and automatically used for |
---|
| 16 | authentication when logging in to other machines using ssh(1). |
---|
| 17 | |
---|
| 18 | The options are as follows: |
---|
| 19 | |
---|
[17138] | 20 | -c Generate C-shell commands on stdout. This is the default if |
---|
| 21 | SHELL looks like it's a csh style of shell. |
---|
[16800] | 22 | |
---|
[17138] | 23 | -s Generate Bourne shell commands on stdout. This is the default if |
---|
[16800] | 24 | SHELL does not look like it's a csh style of shell. |
---|
| 25 | |
---|
| 26 | -k Kill the current agent (given by the SSH_AGENT_PID environment |
---|
| 27 | variable). |
---|
| 28 | |
---|
| 29 | -d Debug mode. When this option is specified ssh-agent will not |
---|
| 30 | fork. |
---|
| 31 | |
---|
| 32 | If a commandline is given, this is executed as a subprocess of the agent. |
---|
| 33 | When the command dies, so does the agent. |
---|
| 34 | |
---|
| 35 | The agent initially does not have any private keys. Keys are added using |
---|
| 36 | ssh-add(1). When executed without arguments, ssh-add(1) adds the |
---|
| 37 | $HOME/.ssh/identity file. If the identity has a passphrase, ssh-add(1) |
---|
| 38 | asks for the passphrase (using a small X11 application if running under |
---|
| 39 | X11, or from the terminal if running without X). It then sends the idenM-- |
---|
| 40 | tity to the agent. Several identities can be stored in the agent; the |
---|
| 41 | agent can automatically use any of these identities. ssh-add -l displays |
---|
| 42 | the identities currently held by the agent. |
---|
| 43 | |
---|
| 44 | The idea is that the agent is run in the user's local PC, laptop, or terM-- |
---|
| 45 | minal. Authentication data need not be stored on any other machine, and |
---|
| 46 | authentication passphrases never go over the network. However, the conM-- |
---|
| 47 | nection to the agent is forwarded over SSH remote logins, and the user |
---|
| 48 | can thus use the privileges given by the identities anywhere in the netM-- |
---|
| 49 | work in a secure way. |
---|
| 50 | |
---|
| 51 | There are two main ways to get an agent setup: Either the agent starts a |
---|
| 52 | new subcommand into which some environment variables are exported, or the |
---|
| 53 | agent prints the needed shell commands (either sh(1) or csh(1) syntax can |
---|
| 54 | be generated) which can be evalled in the calling shell. Later ssh(1) |
---|
| 55 | looks at these variables and uses them to establish a connection to the |
---|
| 56 | agent. |
---|
| 57 | |
---|
| 58 | A unix-domain socket is created (/tmp/ssh-XXXXXXXX/agent.<pid>), and the |
---|
| 59 | name of this socket is stored in the SSH_AUTH_SOCK environment variable. |
---|
| 60 | The socket is made accessible only to the current user. This method is |
---|
| 61 | easily abused by root or another instance of the same user. |
---|
| 62 | |
---|
| 63 | The SSH_AGENT_PID environment variable holds the agent's PID. |
---|
| 64 | |
---|
| 65 | The agent exits automatically when the command given on the command line |
---|
| 66 | terminates. |
---|
| 67 | |
---|
| 68 | FILES |
---|
| 69 | $HOME/.ssh/identity |
---|
| 70 | Contains the protocol version 1 RSA authentication identity of |
---|
[17138] | 71 | the user. This file should not be readable by anyone but the |
---|
| 72 | user. It is possible to specify a passphrase when generating the |
---|
[16800] | 73 | key; that passphrase will be used to encrypt the private part of |
---|
| 74 | this file. This file is not used by ssh-agent but is normally |
---|
| 75 | added to the agent using ssh-add(1) at login time. |
---|
| 76 | |
---|
| 77 | $HOME/.ssh/id_dsa |
---|
| 78 | Contains the protocol version 2 DSA authentication identity of |
---|
| 79 | the user. |
---|
| 80 | |
---|
| 81 | $HOME/.ssh/id_rsa |
---|
| 82 | Contains the protocol version 2 RSA authentication identity of |
---|
| 83 | the user. |
---|
| 84 | |
---|
| 85 | /tmp/ssh-XXXXXXXX/agent.<pid> |
---|
| 86 | Unix-domain sockets used to contain the connection to the authenM-- |
---|
| 87 | tication agent. These sockets should only be readable by the |
---|
| 88 | owner. The sockets should get automatically removed when the |
---|
| 89 | agent exits. |
---|
| 90 | |
---|
| 91 | AUTHORS |
---|
| 92 | OpenSSH is a derivative of the original and free ssh 1.2.12 release by |
---|
| 93 | Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo |
---|
| 94 | de Raadt and Dug Song removed many bugs, re-added newer features and creM-- |
---|
| 95 | ated OpenSSH. Markus Friedl contributed the support for SSH protocol |
---|
| 96 | versions 1.5 and 2.0. |
---|
| 97 | |
---|
| 98 | SEE ALSO |
---|
[17138] | 99 | ssh(1), ssh-add(1), ssh-keygen(1), sshd(8) |
---|
[16800] | 100 | |
---|
[17138] | 101 | BSD September 25, 1999 BSD |
---|