> For the complete documentation index, see [llms.txt](https://strangebutohwell.gitbook.io/knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://strangebutohwell.gitbook.io/knowledge/applications/ssh/ssh-keys/ssh-add.md).

# ssh-add

## Summary

`ssh-add` adds private key identities to the authentication agent, **ssh-agent**. When run without arguments, it adds the files \~/.ssh/id\_rsa, \~/.ssh/id\_dsa, \~/.ssh/id\_ecdsa, and \~/.ssh/id\_ed25519.&#x20;

After loading a private key, ssh-add will try to load corresponding certificate information from the filename obtained by appending -cert.pub to the name of the private key file.

## Syntax

`ssh-add [-cDdkLlqvXx] [-E fingerprint_hash] [-t life] [file ...]`

### Command Options

| ssh-add \[option] | Effect                                                                                                                              |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `-l`              | Lists fingerprints of all identities currently represented by the agent.                                                            |
| `-L`              | Lists public key parameters of all identities currently represented by the agent.                                                   |
| `-d`              | Delete identity                                                                                                                     |
| `-D`              | Delete **all** identities                                                                                                           |
| `-x`              | Lock agent                                                                                                                          |
| `-X`              | Unlock Agent                                                                                                                        |
| `-t [life]`       | Set lifetime (in seconds) when adding identities.                                                                                   |
| `-E [hash]`       | Specifies the hash algorithm used when displaying key fingerprints. Valid options are: “md5” and “sha256”. The default is “sha256”. |
