# Connect to a workstation with SSH

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> Reach your workstations by name from your own SSH tools and your editor's Remote-SSH extension.


Reach your workstations by name from your own SSH tools and your editor's Remote-SSH
extension. That includes `ssh`, `scp`, `rsync` and `git`. `rl shell` works without any
setup, but a tool that reads your own SSH configuration finds a workstation only once you
add Ringleader's configuration to yours.

## Prerequisites

- [Ringleader installed](https://docs-stg.ringleader.dev/install/), with the Ringleader
  application running.
- A running workstation. The examples use a workstation named `my-box`; replace it with
  yours. The [Quickstart](https://docs-stg.ringleader.dev/quickstart/) shows how to create one.
- An `ssh` command. macOS and Windows 11 include one.

## Add Ringleader's SSH configuration

Ringleader keeps an SSH configuration for every workstation you can reach, and updates it
as workstations start, stop and change address. Add it to your own SSH configuration once.


### Use the application


1. Open **Settings**.
2. Turn on **Reach workstations with standard ssh**. The card then shows the file your
   SSH configuration now includes.



### Use the command line


Run:

```bash
rl ssh-config install
```

The command adds three lines at the top of `~/.ssh/config`, or of
`%USERPROFILE%\.ssh\config` on Windows: one `Include` line between two comment lines. It
creates the file if it doesn't exist, and leaves the rest of the file alone.






## Connect to a workstation

Run `ssh` with the workstation's name:

```bash
ssh my-box
```

You're logged in to the workstation, the same as with `rl shell`. Type `exit` to leave.

[Names for a workstation](https://docs-stg.ringleader.dev/workstations/connectivity/editors-ssh/#names-for-a-workstation)
lists the three names a workstation answers to.

## Use other tools with the workstation

Any tool that reads your SSH configuration now reaches the workstation by its name:

```bash
scp report.csv my-box:
rsync -av ./src/ my-box:src/
git clone my-box:repo.git
```

In the Remote-SSH extension of VS Code or Cursor, connect to the host `my-box`.
JetBrains Gateway connects the same way.

## Check the configuration

Run:

```bash
rl ssh-config status
```

It says whether Ringleader's lines are in your SSH configuration, missing, or in the wrong
place.

## Remove the configuration

Take Ringleader's lines out of your SSH configuration. `rl shell` keeps working.


### Use the application


1. Open **Settings**.
2. Turn off **Reach workstations with standard ssh**.



### Use the command line


Run:

```bash
rl ssh-config uninstall
```

The command removes Ringleader's lines and nothing else.






## Troubleshoot

- If `ssh` offers the wrong key and fails to log in, Ringleader's lines are no longer at
  the top of your SSH configuration, so a `Host *` block of your own is read first. Run
  `rl ssh-config install` to move them back to the top.
- If a workstation has the same name as a host in your own SSH configuration, `ssh` with
  that name reaches the workstation. Connect to your own host by another name, or to the
  workstation as `my-box.local.ringleader`.
- If a workstation doesn't connect after it changed its address, Ringleader's background
  service may not be running, so the configuration is out of date. Check with
  `rl daemon status`, and open the Ringleader application to start it.
- If `ssh` on Windows doesn't find a workstation, check which `ssh` your terminal runs with
  `Get-Command ssh`. The copies that come with Git for Windows, Scoop or Chocolatey read
  different configuration files.
- If repeated `ssh` commands are slower on Windows than on a Mac, that is expected. The
  Windows SSH client can't share one connection between commands, so each command makes a
  new connection.

## Next steps

- [Editors and plain SSH](https://docs-stg.ringleader.dev/workstations/connectivity/editors-ssh/) says
  what Ringleader writes for each workstation, and opens a workstation in your editor.
- [`rl ssh-config`](https://docs-stg.ringleader.dev/reference/cli/commands/workstation-access/#rl-ssh-config) describes every form
  of the command.

