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

# Set up SSH Access

> You may want to set up SSH access for Pod if you want to access Pod from your local terminal or open your favorite IDE, such as Visual Studio Code, inside a Pod.

<Note> Pods use public SSH keys to authorize which machine is allowed to connect to Pods. </Note>

<Steps>
  <Step title="Open the terminal on your personal computer." />

  <Step title="Verify that you have a public SSH key on your computer by printing the key:">
    ```bash theme={null}
    $ cat ~/.ssh/id_rsa.pub
    ```

    If you receive an error message saying that **id\_rsa.pub** doesn’t exist, it means that your computer doesn’t have a public SSH key.

    Generate one using ssh-keygen: `$ ssh-keygen`
  </Step>

  <Step title="Copy the public SSH key from your computer.">
    Copy the key with: `$ pbcopy < ~/.ssh/id_rsa.pub`
  </Step>

  <Step title="Go back to Latch, then click Account Settings > Developer Settings.">
    Find [the Developer Settings page here.](https://console.latch.bio/settings/developer)
  </Step>

  <Step title="Paste in your SSH key.">
    Make sure that there is no extra line or space at the end of the SSH key.

    <Note>
      Latch only authorizes access to users whose public SSH keys are added here. If
      you have multiple developers on the team who want to access the same Pod, it
      is recommended that you add their keys here. Latch supports up to 50 keys for
      each Pod.
    </Note>

    <img src="https://mintcdn.com/latchbio/H6zlCTun8E59mJDX/images/ssh-1.png?fit=max&auto=format&n=H6zlCTun8E59mJDX&q=85&s=dcf7a8e659b4006390ffc52bb021ca5d" alt="" width="1126" height="878" data-path="images/ssh-1.png" />
  </Step>

  <Step title="Once your Pod is created, copy the SSH endpoint command on the bottom right sidebar to your terminal.">
    You can only SSH into a Pod if it is running.

    <img src="https://mintcdn.com/latchbio/H6zlCTun8E59mJDX/images/ssh-2.png?fit=max&auto=format&n=H6zlCTun8E59mJDX&q=85&s=0da8826f11bfeebd97dde99e34f76425" alt="" width="1144" height="686" data-path="images/ssh-2.png" />
  </Step>
</Steps>

### Troubleshooting

Below are a few common errors when trying to connect to Pods via SSH access.

<AccordionGroup>
  <Accordion title="Connection closed by remote host">
    ```bash theme={null}
    kex_exchange_identification: Connection closed by remote host
    ```

    * This means that an error cannot be established between your local computer and Pods.
    * Try stopping and starting your Pod to refresh the connection.

    <Warning>
      You cannot SSH into a Pod when the status of Pod is **Dormant** or **Starting**. You can only establish a connection to the Pod when it is running.
    </Warning>
  </Accordion>

  <Accordion title="Permission denied (publickey)">
    * The error means that the SSH key Pod is authenticating is different from the SSH key on the computer you are trying to connect from. Hence, Pod rejects your connection.
    * Double check at the SSH key you have on [Account Settings > Developer](https://console.latch.bio/settings/developer) is the same as the SSH key of the machine you’re trying to connect from.
    * If the SSH keys are the same, but you are still unable to connect to Pod via SSH, this may mean that you added your SSH keys to the Developer Settings after the Pod was created. Manually restart your Pod to load in the SSH keys.
  </Accordion>
</AccordionGroup>
