# SSH Agent

{% hint style="info" %}
For a full remote connection management tool that supports privileged sessions, session recording and other advanced capabilities over zero-trust cloud connections, we recommend using our [KeeperPAM platform](/keeperpam/readme.md#overview).

This SSH Agent described in Commander uses direct line-of-sight SSH connections. The KeeperPAM platform includes an [SSH Agent](/keeperpam/privileged-access-manager/ssh-agent.md) within the Keeper Desktop application.
{% endhint %}

## SSH Agent

The `ssh-agent` command is used to load up all of the SSH keys in the vault and start an SSH Agent service. SSH connections can be seamlessly established directly using the Keeper Commander SSH Agent without having to store keys on the local filesystem. SSH connections can then be established using any standard terminal.

The SSH agent service scans all records in the Keeper Vault based on different criteria such as:

* A record type "SSH Key" or "Server" with a private key and optional password/passphrase
* Any record with a single SSH key file attachment

### ssh-agent command

**Command:** `ssh-agent`

**Detail:** Starts a local SSH Agent process on the local computer using keys from the vault.

**Options:**

* `start`: Starts the SSH Agent service and loads up all keys
* `stop`: Stops the SSH Agent service
* `info`: Displays SSH Agent status
* `log`: Displays connection log history

### Examples

Starting the SSH Agent Service from the Commander CLI

```
ssh-agent start
```

Directly starting the SSH Agent without the shell:

```
keeper ssh-agent start
```

{% hint style="info" %}
To use the SSH Agent from your favorite terminal or connection tool, the environmental variable SSH\_AUTH\_SOCK must be set in the terminal or in your startup file. For example....\
\
**export** **SSH\_AUTH\_SOCK=\~/.keeper/me\@demo.com.ssh\_agent**\
\
Then, simply SSH from your terminal:\
\
$ ssh \<host>
{% endhint %}

Stopping the SSH Agent service

```
ssh-agent stop
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/commander-cli/command-reference/connection-commands/ssh-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
