> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to an account

> Open a session on an account from your browser or the Infisical CLI.

You can connect to an [account](https://infisical.com/docs/documentation/platform/pam/accounts/overview.md) in your browser or with the Infisical CLI. Either way, Infisical opens a [session](https://infisical.com/docs/documentation/platform/pam/sessions/overview), and a [gateway](https://infisical.com/docs/documentation/platform/gateways/overview.md) supplies the account's credential so that you never see it. Infisical records everything you do in the session.

> [!TIP]
>
> To give an AI agent access to accounts, use [`infisical pam agentic access`](https://infisical.com/docs/documentation/platform/pam/ai-agents/overview) instead.

## Prerequisites

* The Admin, Operator, or Connector [role](https://infisical.com/docs/documentation/platform/pam/concepts/access-control.md) on the account or its folder
* An approved [access request](https://infisical.com/docs/documentation/platform/pam/access-requests/overview.md), if the account's template requires approval
* To connect with the CLI, the [Infisical CLI](https://infisical.com/docs/cli/overview.md) installed and logged in with [`infisical login`](https://infisical.com/docs/cli/reference#login)

## Launch a session

**Step 1**

Go to **Privileged Access Management** > **Accounts** and find the account.

**Step 2**

Select the rocket icon on the account's row.

If the row shows a key icon instead, the account requires approval. Select the key icon to [request access](https://infisical.com/docs/documentation/platform/pam/access-requests/overview.md), and launch the session once an approver approves the request.

**Step 3**

Select a launch method, then connect:

**Browser**

Select **Browser**, then select **Connect in Browser**. The session opens in a new tab.

What the tab shows depends on the account type:

* **PostgreSQL, MySQL, Snowflake, and ClickHouse**: a table browser and a SQL editor
* **Redis**: a console for Redis commands
* **SSH**: a terminal
* **Windows and Windows AD**: a remote desktop
* **AWS IAM**: the AWS Management Console

> [!NOTE]
>
> Only some [account types](https://infisical.com/docs/documentation/platform/pam/accounts/account-types) support the browser.

**CLI**

Select **CLI**, then copy the command and run it in your terminal. The command has this form:

```bash theme={"dark"}
infisical pam access <folder>/<account>
```

What happens next depends on the account type:

* **SSH**: The CLI opens a shell on the server (add `--proxy` to use your own SSH client instead)
* **AWS IAM**: The CLI writes temporary credentials to your AWS credentials file
* **Every other account type**: The CLI starts a local proxy on `127.0.0.1` and prints its port

If the CLI starts a proxy, connect your own client, such as `psql` or `kubectl`, to the printed port. The proxy signs in for you, so the client doesn't need a password.

The session lasts one hour unless you set `--duration`. For the other flags, see the [CLI reference](https://infisical.com/docs/cli/reference.md#pam-access).

If the account's template requires a reason, Infisical asks for one before the session starts. If the template requires MFA, Infisical asks you to complete MFA in your browser.

## End a session

A session ends when:

* You close the browser tab, or press `Ctrl+C` in the terminal that runs the CLI
* The session reaches the maximum duration set by the account's [template](https://infisical.com/docs/documentation/platform/pam/templates/overview.md)
* Someone with the Admin role on the account or its folder [terminates the session](https://infisical.com/docs/documentation/platform/pam/sessions/overview)

## Next steps

> **[Sessions](https://infisical.com/docs/documentation/platform/pam/sessions/overview)**
>
> Review and end the connections that people and agents make to your accounts.

> **[View credentials](https://infisical.com/docs/documentation/platform/pam/accounts/view-credentials.md)**
>
> Reveal the password or key stored for an account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.