Back to Docs

SSH Access

Connect to your GPU instances via SSH

SSH Access Guide

Connect securely to your GPU instances via SSH or browser terminal.

Connection Methods

You have two ways to access your GPU:

  • Browser Terminal - Click the terminal icon on your GPU card for instant access
  • SSH - Connect from your local terminal using SSH keys or password

Browser Terminal

The simplest way to access your GPU:

  1. Find your running GPU in the dashboard
  2. Click the Terminal icon
  3. A browser-based terminal opens with full shell access

No setup required. Works immediately when your GPU is running.

SSH Access

Quick Start

  1. Go to Account SettingsSSH Keys
  2. Add your public SSH key
  3. Copy the SSH command from your GPU card
  4. Connect from your terminal
ssh -p <port> ubuntu@<host>

Using Password Authentication

Each GPU instance also has a password shown on the GPU card. You can use this if you prefer not to set up SSH keys:

  1. Click to reveal the password on your GPU card
  2. Copy the SSH command
  3. Enter the password when prompted

Setting Up SSH Keys

Use an Existing Key

If you already have an SSH key pair:

# Display your public key
cat ~/.ssh/id_rsa.pub
# or
cat ~/.ssh/id_ed25519.pub

Copy the output and paste it in Account Settings → SSH Keys.

Generate a New Key

# Generate a new ED25519 key (recommended)
ssh-keygen -t ed25519 -C "your_email@example.com"

# Or generate an RSA key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

# Display the public key
cat ~/.ssh/id_ed25519.pub

Key Format

Your public key should look like:

ssh-ed25519 AAAAC3NzaC1... your_email@example.com

or

ssh-rsa AAAAB3NzaC1yc2... your_email@example.com

Key Limits

You can add up to 10 SSH keys per account. Each key is identified by its fingerprint.

SSH Config (Recommended)

Add to ~/.ssh/config for easier access:

Host my-gpu
    HostName 35.190.160.152
    Port 30123
    User ubuntu
    IdentityFile ~/.ssh/id_ed25519

Then connect with just:

ssh my-gpu

File Transfer

Using SCP

# Upload a file
scp -P 30123 local_file.txt ubuntu@35.190.160.152:/home/ubuntu/

# Download a file
scp -P 30123 ubuntu@35.190.160.152:/home/ubuntu/results.csv ./

# Upload a directory
scp -P 30123 -r ./my_project ubuntu@35.190.160.152:/home/ubuntu/

Using rsync (Recommended for Large Transfers)

# Sync a directory
rsync -avz -e "ssh -p 30123" ./data/ ubuntu@35.190.160.152:/home/ubuntu/data/

# With progress
rsync -avz --progress -e "ssh -p 30123" ./model.pt ubuntu@35.190.160.152:/home/ubuntu/

Using SFTP

sftp -P 30123 ubuntu@35.190.160.152

Port Forwarding

Forward a Remote Port to Local

Access a service running on your GPU locally:

# Forward GPU's port 8888 to your local port 8888
ssh -p 30123 -L 8888:localhost:8888 ubuntu@35.190.160.152

Then open http://localhost:8888 in your browser.

Common Use Cases

# Jupyter Notebook
ssh -p 30123 -L 8888:localhost:8888 ubuntu@35.190.160.152

# TensorBoard
ssh -p 30123 -L 6006:localhost:6006 ubuntu@35.190.160.152

# Multiple ports
ssh -p 30123 -L 8888:localhost:8888 -L 6006:localhost:6006 ubuntu@35.190.160.152

Tip: You can also use the Service Exposure feature to make ports publicly accessible without SSH tunneling.

Troubleshooting

Permission Denied

Permission denied (publickey)

Solutions:

  • Ensure you added your public key (not private)
  • Check the key was saved in Account Settings
  • Try using the password authentication instead
  • Verify you're using the correct identity file: ssh -v -p <port> ubuntu@<host>

Connection Refused

ssh: connect to host ... port ...: Connection refused

Solutions:

  • Verify your GPU is in "Running" status
  • Check the port number is correct
  • Wait 30 seconds after starting a new instance

Host Key Verification Failed

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

This can happen if you get a new GPU with the same IP. Remove the old key:

ssh-keygen -R "[35.190.160.152]:30123"

VS Code Remote SSH

Connect VS Code directly to your GPU:

  1. Install the "Remote - SSH" extension
  2. Add your GPU to SSH config (see above)
  3. Click the green remote icon in VS Code
  4. Select "Connect to Host" → your GPU

This gives you a full IDE experience on your remote GPU.

Security Best Practices

  1. Use ED25519 keys - More secure and faster than RSA
  2. Protect your private key - Never share it, set permissions to 600
  3. Use passphrases - Add a passphrase when generating keys
  4. Remove unused keys - Delete keys you no longer use from Account Settings
# Set correct permissions
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub

Need Help?

Contact us at support@packet.ai