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

# Command Line (SSH)

You can directly access your workspace via SSH for editing code directly using a [command-line editor](/classic/user/references/ides-and-editors/command-line), such as Vim & Emacs or for connecting SSH supported applications such as a database client.

## Workspace SSH approaches

There are two ways to access a workspace via SSH using an SSH key or an Access Token.

<Frame caption="Copy SSH key from modal">
  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-key-modal-dark-light-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=a9f4fafa04fee4c3d7291e7178ef5d4c" className="block dark:hidden" width="1472" height="968" data-path="images/docs/ssh-key-modal-dark-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-key-modal-dark-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=dc4378e6ea9dde55e3f8a89feac846db" className="hidden dark:block" width="1478" height="904" data-path="images/docs/ssh-key-modal-dark-theme.png" />
</Frame>

1. **SSH Key** (recommended) - By creating your own public/private SSH key pair, and uploading the public key to Gitpod you can directly SSH into a Gitpod workspace. Uploading a public key means that you do not need to keep re-visiting the Gitpod dashboard to retrieve an SSH command. It is also a more secure approach. See [configure SSH](/classic/user/configure/user-settings/ssh) for more.

2. **Access Token** - Alternatively, you can access a workspace using the copy/paste SSH command. This approach uses an access token which is reset on every workspace start. This approach is useful for quick SSH access, or when installing an SSH key locally is not possible, such as on some devices.

## SSH key Access

<Note>
  You must upload a public key to Gitpod before you can access your workspace
  using an SSH key. See [configure SSH](/classic/user/configure/user-settings/ssh) for
  more.
</Note>

To access a workspace using an SSH Key:

1. Visit [your workspace list](https://gitpod.io/workspaces) in Gitpod
2. View a running Gitpod workspace and click the more actions menu
3. Select "connect via SSH"
4. Copy paste the selected command

<br />

<Frame caption="Accessing an SSH key from the workspace list">
  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-workspace-list-light-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=36ec32ec45b5bb6d88a68f2fa1a1fe30" className="block dark:hidden" width="1578" height="1246" data-path="images/docs/ssh-workspace-list-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-workspace-list-dark-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=a8dc650cbde22b7ba07d6f214fca52ae" className="hidden dark:block" width="1634" height="1258" data-path="images/docs/ssh-workspace-list-dark-theme.png" />
</Frame>

<br />

<Frame caption="SSH Key access via modal">
  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-key-modal-dark-light-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=a9f4fafa04fee4c3d7291e7178ef5d4c" className="block dark:hidden" width="1472" height="968" data-path="images/docs/ssh-key-modal-dark-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-key-modal-dark-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=dc4378e6ea9dde55e3f8a89feac846db" className="hidden dark:block" width="1478" height="904" data-path="images/docs/ssh-key-modal-dark-theme.png" />
</Frame>

You can also access the SSH connection string from the workspace start page, which is shown to users who have selected a desktop IDE or editor as their [preference](https://gitpod.io/preferences).

<Frame caption="SSH to a workspace via the workspace splash page">
  <img src="https://mintcdn.com/gitpod-13c83c2b/XKLO9bNbR42T1Cqo/images/docs/ssh-connect-splash-dark-theme.png?fit=max&auto=format&n=XKLO9bNbR42T1Cqo&q=85&s=fc01197c7b1712a582d6004ea10fd24a" className="block dark:hidden" width="1476" height="1290" data-path="images/docs/ssh-connect-splash-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/XKLO9bNbR42T1Cqo/images/docs/ssh-connect-splash-light-theme.png?fit=max&auto=format&n=XKLO9bNbR42T1Cqo&q=85&s=95b607f92f844f604506f4ab54f42bc6" className="hidden dark:block" width="1476" height="1290" data-path="images/docs/ssh-connect-splash-light-theme.png" />
</Frame>

## Access Token SSH

You can currently copy/paste a simple SSH command to get command line access to your workspace from the Gitpod dashboard.

1. Visit [your workspace list](https://gitpod.io/workspaces) in Gitpod
2. View a running Gitpod workspace and click the more actions menu
3. Select "connect via SSH"
4. Navigate to the "Access Token" tab
5. Copy paste the selected command

<br />

<Frame caption="Accessing an SSH key from the workspace list">
  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-workspace-list-dark-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=a8dc650cbde22b7ba07d6f214fca52ae" className="block dark:hidden" width="1634" height="1258" data-path="images/docs/ssh-workspace-list-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/docs/ssh-workspace-list-light-theme.png?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=36ec32ec45b5bb6d88a68f2fa1a1fe30" className="hidden dark:block" width="1578" height="1246" data-path="images/docs/ssh-workspace-list-light-theme.png" />
</Frame>

<br />

<Frame caption="SSH via access token from the workspace list">
  <img src="https://mintcdn.com/gitpod-13c83c2b/XKLO9bNbR42T1Cqo/images/docs/ssh-accesss-modal-dark-theme.png?fit=max&auto=format&n=XKLO9bNbR42T1Cqo&q=85&s=2731fbf886c78832db9798e6134cefb7" className="hidden dark:block" width="1478" height="966" data-path="images/docs/ssh-accesss-modal-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/XKLO9bNbR42T1Cqo/images/docs/ssh-accesss-modal-light-theme.png?fit=max&auto=format&n=XKLO9bNbR42T1Cqo&q=85&s=7fed4daf5c87130a6ddbcd03b3d0c5ce" className="block dark:hidden" width="1472" height="968" data-path="images/docs/ssh-accesss-modal-light-theme.png" />
</Frame>

You can also access the SSH connection string from the workspace start page, which is shown to users who have selected a desktop IDE or editor as their [preference](https://gitpod.io/preferences).

<Frame caption="SSH to a workspace via the workspace splash page">
  <img src="https://mintcdn.com/gitpod-13c83c2b/XKLO9bNbR42T1Cqo/images/docs/ssh-connect-splash-dark-theme.png?fit=max&auto=format&n=XKLO9bNbR42T1Cqo&q=85&s=fc01197c7b1712a582d6004ea10fd24a" className="hidden dark:block" width="1476" height="1290" data-path="images/docs/ssh-connect-splash-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/XKLO9bNbR42T1Cqo/images/docs/ssh-connect-splash-light-theme.png?fit=max&auto=format&n=XKLO9bNbR42T1Cqo&q=85&s=95b607f92f844f604506f4ab54f42bc6" className="block dark:hidden" width="1476" height="1290" data-path="images/docs/ssh-connect-splash-light-theme.png" />
</Frame>

## SSH via Local Companion

<Note>
  It is possible to access your Gitpod workspaces via the command line using
  [local companion](/classic/user/references/ides-and-editors/local-companion), however
  access using an SSH key is the preferred approach.
</Note>
