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

# SSH

> How to setup SSH tunnel access for your containers

# Secure Tunnel Access via Docker and SSH

GPU Trader provides zero-trust SSH tunnel access to your deployed containers. This means no open ports on your host, no blanket network access, and no risk of leaving insecure endpoints exposed.

Each connection is authorized per session and encrypted end-to-end, ensuring that only authenticated users with the correct SSH keys can access the container. Once you disconnect, the tunnel automatically shuts down—leaving nothing open behind.

This guide outlines how to spin up a secure tunnel using Docker and immediately SSH into your GPU container. Whether you're running jobs, monitoring logs, or debugging live workloads, this gives you shell access without compromising on security.

## Prerequisites

Before you can SSH into your container, make sure the following are set up on your local machine:

You’ll need Docker installed and running to launch the local tunnel container. Follow the guide below for your operating system:

macOS: [Install Docker Desktop for Mac](https://docs.docker.com/desktop/setup/install/mac-install/)

Windows: [Install Docker Desktop for Windows](https://docs.docker.com/desktop/setup/install/windows-install/)

Linux:
Most distributions offer Docker via their package manager. For example, on Ubuntu:

```bash theme={null}
sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
```

Or use the official guide: [Install Docker Engine on Linux](https://docs.docker.com/desktop/setup/install/linux/)

Once installed, test Docker is running:

```bash theme={null}
docker version
```

You should see client and server version output. If not, refer to the troubleshooting section of the install docs.

## Usage

### Create an SSH Keypair

To create an SSH keypair, run the following command (you'll need to keep track of the filename and path):

```bash theme={null}
# On Linux or macOS:
ssh-keygen -t rsa -b 4096 -f <filename>

# On Windows (using PowerShell):
ssh-keygen -t rsa -b 4096 -f <filename>
```

This will generate:

* A private key (e.g., `<filename>`)
* A public key (e.g., `<filename>.pub`)

### Add your SSH Public Key to your Account

Navigate to your Profile account settings page
Copy the contents of your public key file (e.g., `<filename>.pub`) and paste it into the SSH keys section.

<img style={{ borderRadius: '0.5rem' }} src="https://mintcdn.com/gputrader/Zyo1imopfCEetfyQ/renters/images/ssh/add-sshkey.png?fit=max&auto=format&n=Zyo1imopfCEetfyQ&q=85&s=d2c114f631d1670c3aa21c4f28307052" width="4438" height="2786" data-path="renters/images/ssh/add-sshkey.png" />

#### Choose Your Template

Pick a template you want to use and toggle the SSH tunnel option to enable it.

<img style={{ borderRadius: '0.5rem' }} src="https://mintcdn.com/gputrader/Zyo1imopfCEetfyQ/renters/images/ssh/ssh-toggle.png?fit=max&auto=format&n=Zyo1imopfCEetfyQ&q=85&s=237873fc886ca57fd182ee21151cc1a4" width="1684" height="202" data-path="renters/images/ssh/ssh-toggle.png" />

After your stack has been deployed there will be a drop down under the ports section that says "SSH".

<img style={{ borderRadius: '0.5rem' }} src="https://mintcdn.com/gputrader/Zyo1imopfCEetfyQ/renters/images/ssh/ssh-port.png?fit=max&auto=format&n=Zyo1imopfCEetfyQ&q=85&s=44702bfbc2e073ee1cb8aba32b561138" width="3948" height="1120" data-path="renters/images/ssh/ssh-port.png" />

Click on SSH

<img style={{ borderRadius: '0.5rem' }} src="https://mintcdn.com/gputrader/Zyo1imopfCEetfyQ/renters/images/ssh/ssh-modal.png?fit=max&auto=format&n=Zyo1imopfCEetfyQ&q=85&s=8e17ee83139937c03517dd33761d861c" width="1864" height="1020" data-path="renters/images/ssh/ssh-modal.png" />

Click on either "Copy Unix Script" or "Copy Windows Script" to copy the script to your clipboard.

Open a terminal on your local machine and paste the copied script into it. This script will start a Docker container with the tunnel service and automatically SSH into your device. You will need to provide the path and file name of the private SSH Key you created earlier.

Once connected you can run commands on your device as if you were logged in directly.
