1SSH-ADD(1)                BSD General Commands Manual               SSH-ADD(1)
2

NAME

4     ssh-add — adds private key identities to the OpenSSH authentication agent
5

SYNOPSIS

7     ssh-add [-cDdKkLlqvXx] [-E fingerprint_hash] [-S provider] [-t life]
8             [file ...]
9     ssh-add -s pkcs11
10     ssh-add -e pkcs11
11     ssh-add -T pubkey ...
12

DESCRIPTION

14     ssh-add adds private key identities to the authentication agent,
15     ssh-agent(1).  When run without arguments, it adds the files
16     ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ecdsa_sk,
17     ~/.ssh/id_ed25519, and ~/.ssh/id_ed25519_sk.  After loading a private
18     key, ssh-add will try to load corresponding certificate information from
19     the filename obtained by appending -cert.pub to the name of the private
20     key file.  Alternative file names can be given on the command line.
21
22     If any file requires a passphrase, ssh-add asks for the passphrase from
23     the user.  The passphrase is read from the user's tty.  ssh-add retries
24     the last passphrase if multiple identity files are given.
25
26     The authentication agent must be running and the SSH_AUTH_SOCK environ‐
27     ment variable must contain the name of its socket for ssh-add to work.
28
29     The options are as follows:
30
31     -c      Indicates that added identities should be subject to confirmation
32             before being used for authentication.  Confirmation is performed
33             by ssh-askpass(1).  Successful confirmation is signaled by a zero
34             exit status from ssh-askpass(1), rather than text entered into
35             the requester.
36
37     -D      Deletes all identities from the agent.
38
39     -d      Instead of adding identities, removes identities from the agent.
40             If ssh-add has been run without arguments, the keys for the
41             default identities and their corresponding certificates will be
42             removed.  Otherwise, the argument list will be interpreted as a
43             list of paths to public key files to specify keys and certifi‐
44             cates to be removed from the agent.  If no public key is found at
45             a given path, ssh-add will append .pub and retry.
46
47     -E fingerprint_hash
48             Specifies the hash algorithm used when displaying key finger‐
49             prints.  Valid options are: “md5” and “sha256”.  The default is
50             “sha256”.
51
52     -e pkcs11
53             Remove keys provided by the PKCS#11 shared library pkcs11.
54
55     -K      Load resident keys from a FIDO authenticator.
56
57     -k      When loading keys into or deleting keys from the agent, process
58             plain private keys only and skip certificates.
59
60     -L      Lists public key parameters of all identities currently repre‐
61             sented by the agent.
62
63     -l      Lists fingerprints of all identities currently represented by the
64             agent.
65
66     -q      Be quiet after a successful operation.
67
68     -S provider
69             Specifies a path to a library that will be used when adding FIDO
70             authenticator-hosted keys, overriding the default of using the
71             internal USB HID support.
72
73     -s pkcs11
74             Add keys provided by the PKCS#11 shared library pkcs11.
75
76     -T pubkey ...
77             Tests whether the private keys that correspond to the specified
78             pubkey files are usable by performing sign and verify operations
79             on each.
80
81     -t life
82             Set a maximum lifetime when adding identities to an agent.  The
83             lifetime may be specified in seconds or in a time format speci‐
84             fied in sshd_config(5).
85
86     -v      Verbose mode.  Causes ssh-add to print debugging messages about
87             its progress.  This is helpful in debugging problems.  Multiple
88             -v options increase the verbosity.  The maximum is 3.
89
90     -X      Unlock the agent.
91
92     -x      Lock the agent with a password.
93

ENVIRONMENT

95     DISPLAY and SSH_ASKPASS
96             If ssh-add needs a passphrase, it will read the passphrase from
97             the current terminal if it was run from a terminal.  If ssh-add
98             does not have a terminal associated with it but DISPLAY and
99             SSH_ASKPASS are set, it will execute the program specified by
100             SSH_ASKPASS (by default “ssh-askpass”) and open an X11 window to
101             read the passphrase.  This is particularly useful when calling
102             ssh-add from a .xsession or related script.  (Note that on some
103             machines it may be necessary to redirect the input from /dev/null
104             to make this work.)
105
106     SSH_AUTH_SOCK
107             Identifies the path of a UNIX-domain socket used to communicate
108             with the agent.
109
110     SSH_SK_PROVIDER
111             Specifies a path to a library that will be used when loading any
112             FIDO authenticator-hosted keys, overriding the default of using
113             the built-in USB HID support.
114

FILES

116     ~/.ssh/id_dsa
117     ~/.ssh/id_ecdsa
118     ~/.ssh/id_ecdsa_sk
119     ~/.ssh/id_ed25519
120     ~/.ssh/id_ed25519_sk
121     ~/.ssh/id_rsa
122             Contains the DSA, ECDSA, authenticator-hosted ECDSA, Ed25519,
123             authenticator-hosted Ed25519 or RSA authentication identity of
124             the user.
125
126     Identity files should not be readable by anyone but the user.  Note that
127     ssh-add ignores identity files if they are accessible by others.
128

EXIT STATUS

130     Exit status is 0 on success, 1 if the specified command fails, and 2 if
131     ssh-add is unable to contact the authentication agent.
132

SEE ALSO

134     ssh(1), ssh-agent(1), ssh-askpass(1), ssh-keygen(1), sshd(8)
135

AUTHORS

137     OpenSSH is a derivative of the original and free ssh 1.2.12 release by
138     Tatu Ylonen.  Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
139     de Raadt and Dug Song removed many bugs, re-added newer features and cre‐
140     ated OpenSSH.  Markus Friedl contributed the support for SSH protocol
141     versions 1.5 and 2.0.
142
143BSD                              May 10, 2020                              BSD
Impressum