docs/ssh-key.md
Rama main · réplica de lectura del repositorio original.
---
title: SSH key
noIndex: false
noContent: false
---
<Callout status="info">
If you want to create an SSH tunnel to your database, or internal service, we recommend using either built-in SSH tunneling capability in a supported [Database integration](https://deepnote.com/docs/securing-connections#using-ssh-to-connect-to-your-data), or use a standalone [SSH Tunnel](https://deepnote.com/docs/securing-connections?#ssh-tunnel-integration) integration.
</Callout>
SSH key integration is the recommended way to store SSH keys in Deepnote. When you connect the integration to a project, Deepnote will add your private key as environment variable so you can use it to connect to remote machines, or create tunnels to service within cloud services not accessible on public internet.
This integration is useful if you already have a private key you want to use to connect to a private network, and you are not able to add the public key of your Deepnote workspace to the remote resource.

Copy the private key, commonly stored as a `.pem` file, into the text box and give the integration a descriptive name, such as AWS Redshift Tunnel key. After creating the integration, connect it to your project. The example below shows how to use the key with `ssh-agent`.
<Callout status="info">
Replace `$TEST_SSH_KEY` with your integration's environment variable. To see the variable name, connect the integration to your project and click on "How to use" button.
</Callout>
```
eval "$(ssh-agent)" > /dev/null && \
source <(/compute-helpers/code/print-integration-env-vars.py) && \
echo "$TEST_SSH_KEY" | ssh-add - > /dev/null && \
ssh <user>@<host>
```