ssh-add
Section: SSH (1)
Updated: November 8, 1995
SSH man page index
Return to SSH FAQ
NAME
ssh-add - adds identities for the authentication agent
SYNOPSIS
ssh-add[-p][-l][-d][-D][file...]
DESCRIPTION
Ssh-addadds identities to the authentication agent,ssh-agent.When run without arguments, it adds the file$HOME/.ssh/identity.Alternative file names can be given on thecommand line. If any file requires a passphrase,ssh-addasks for the passphrase from the user. If the -p option is given thenthe passphrase is read from stdin, otherwise if the user is using X11,the passphrase is requested using a small X11 program; otherwise it isread from the user's tty. (Note: it may be necessary to redirect stdinfrom /dev/null to get the passphrase requested using X11.)
The authentication agent must be running and must be an ancestor ofthe current process forssh-addto work.
OPTIONS
- -p
- Read passphrase from stdin (or pipe).
- -l
- Lists all identities currently represented by the agent.
- -d
- Instead of adding the identity, removes the identity from the agent.
- -D
- Deletes all identities from the agent.
RETURN STATUS
Ssh-addreturns one of the following exit statuses. These may be useful in scripts.
- 0
- The requested operation was performed successfully.
- 1
- No connection could be made to the authentication agent. Presumablythere is no authentication agent active in the execution environmentofssh-add.
- 2
- The user did not supply a required passphrase.
- 3
- An identify file could not be found, was not readable, or was inbad format.
- 4
- The agent does not have the requested identity.
- 5
- An unspecified error has occurred; this is a catch-all for errors notlisted above.
FILES
- $HOME/.ssh/identity
- Contains the RSA authentication identity of the user. This fileshould not be readable by anyone but the user. It is possible tospecify a passphrase when generating the key; that passphrase will beused to encrypt the private part of this file. This is thedefault file added byssh-addwhen no other files have been specified.
- Ifssh-addneeds a passphrase, it will read the passphrase from the currentterminal if it was run from a terminal. Ifssh-adddoes not have a terminal associated with it butDISPLAYis set, itwill open an X11 window to read the passphrase. This is particularlyuseful when callingssh-addfrom a .Xsession or related script. (Note that on some machines itmay be necessary to redirect the input from /dev/null to make this work.)
AUTHOR
Tatu Ylonen <ylo@ssh.com>
SEE ALSO
ssh-agent(1),ssh-keygen(1),ssh(1),sshd(8)
This document was created by man2html,using the manual pages.
Time: 05:40:16 GMT, September 09, 1999