Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

3.1 KB
Raw Blame
---
title: "SSH accounts"
sidebarTitle: "SSH"
description: "Give people shell access to Linux and Unix servers."
---

An SSH account lets people open a shell on a Linux or Unix server without seeing the server's password or key. They connect in a browser terminal or through the Infisical CLI, and Infisical records each [session](/documentation/platform/pam/sessions/overview).

## Prerequisites

- The Admin [role](/documentation/platform/pam/concepts/access-control) on the [folder](/documentation/platform/pam/folders/overview) you'll add the account to
- A [Gateway](/documentation/platform/gateways/overview) that can reach the server on its SSH port

## Create an account

<Steps>
  <Step>
    Go to **Privileged Access Management** > **Accounts** and select **Add Account**.
  </Step>
  <Step>
    Select the **Folder** to add the account to and an SSH **Account Template**, such as the default `ssh` [template](/documentation/platform/pam/templates/overview), then select **Next**.
  </Step>
  <Step>
    Enter a **Name** for the account and the server's connection details:

    | Field | Description |
    |-------|-------------|
    | **Host** | The server's hostname or IP address |
    | **Port** | The server's SSH port (defaults to `22`) |
    | **Gateway** | The Gateway that connects to the server (only shown if the template doesn't set one) |
  </Step>
  <Step>
    Select an **Auth Method**, enter the **Username** to log in as, and fill in the fields for that [authentication method](#authentication-methods).
  </Step>
  <Step>
    Select **Create**.
  </Step>
</Steps>

## Authentication methods

| Method | What you enter | What the server needs |
|--------|----------------|-----------------------|
| **Certificate** | Only the username | To trust the account's certificate authority (CA), as described in [Set up SSH certificate authentication](/documentation/platform/pam/guides/ssh-certificate-auth) |
| **Public Key** | A **Private Key** in OpenSSH format | The matching public key in the user's `~/.ssh/authorized_keys` file |
| **Password** | The user's **Password** | `PasswordAuthentication yes` in `sshd_config` |

Use **Certificate** where you can. Infisical issues a short-lived certificate for each session, so the account stores no password or key that could leak.

## Connect

People can open a terminal in the browser or connect through the CLI. To learn how to launch a session, see [Connect to an account](/documentation/platform/pam/accounts/connect).

The CLI opens a shell on the server:

```bash
infisical pam access <folder>/<account>
```

To run one command instead of opening a shell, put the command after `--`:

```bash
infisical pam access <folder>/<account> -- systemctl status nginx
```

To use your own SSH client, or to copy files with `scp`, `sftp`, or `rsync`, add `--proxy`. The CLI then starts a local proxy and prints the port to connect to.

## Next steps

<CardGroup cols={2}>
  <Card title="SSH certificate auth" icon="key" href="/documentation/platform/pam/guides/ssh-certificate-auth">
    Let people connect to SSH servers with short-lived certificates instead of stored credentials.
  </Card>
</CardGroup>