← derez.ai Home

SSH for AI Agents

Everything you need to connect to, manage, and transfer files to and from your agent's Linux instance. Your agent comes with full SSH access — here's how to make the most of it.

Chapters

  1. Accessing SSH via Encryption Keys
  2. Copying Files In and Out — Derez Sync
  3. Tmux — Persistent Terminal Sessions
  4. Midnight Commander — File Management with a UI
  5. Vim — Edit and Read Files on Your Agent

1 Accessing SSH via Encryption Keys

Your derez.ai agent runs in its own Linux container with full root SSH access. The most secure way to connect is using SSH key pairs — a public key stored on the server and a private key kept on your machine.

Generate an SSH Key Pair

If you don't already have an SSH key, create one on your local machine:

ssh-keygen -t ed25519 -C "my-derez-agent"

This creates two files in ~/.ssh/:

Add the Public Key to Your Agent

Copy the content of your public key:

cat ~/.ssh/id_ed25519.pub

Then open your agent from the dashboard and add the key to ~/.ssh/authorized_keys:

echo "ssh-ed25519 AAAA... your-key" >> ~/.ssh/authorized_keys

Connect via SSH

Once the key is in place, connect from your machine:

ssh root@<your-agent-ip>

You're in — root access, full shell, no password required.

Pro Tip: You can also set or reset your SSH password from the dashboard at any time. The password is pushed securely into the container and works alongside your key-based access.

2 Copying Files In and Out — Derez Sync

derez.ai agents include a built-in sync mechanism that lets you transfer files between your local machine and your agent's instance without manual SCP or SFTP commands.

How It Works

The sync tool uses your existing SSH connection and handles directory structure, permissions, and incremental transfers automatically. It's designed for workflows where you iterate on scripts, configuration files, or data sets locally and push them to the agent.

Copy a File to Your Agent

scp /path/to/local/file root@<your-agent-ip>:/root/destination/

Copy a File from Your Agent

scp root@<your-agent-ip>:/root/source/file /path/to/local/destination/

Sync an Entire Directory

For larger directory trees, use rsync — it only transfers what changed:

rsync -avz --progress /local/project/ root@<your-agent-ip>:/root/project/

The -a flag preserves permissions and timestamps, -v gives verbose output, and -z compresses data during transfer.

Pro Tip: Use --delete with rsync if you want the destination to exactly mirror the source (removes files on the agent that don't exist locally). Great for keeping dev environments in sync.

3 Tmux — Persistent Terminal Sessions

Tmux is a terminal multiplexer that keeps your sessions alive even after you disconnect. If you're running long tasks — model fine-tuning, data processing, agent training — Tmux ensures nothing stops when your SSH connection drops.

Start a New Tmux Session

tmux new -s my-session

This opens a new terminal inside Tmux. Run any command — it keeps running when you disconnect.

Detach and Reattach

Press Ctrl+B then D to detach from the session. Your commands keep running on the server. To come back later:

tmux attach -t my-session

List Active Sessions

tmux list-sessions

Kill a Session

tmux kill-session -t my-session

Useful Tmux Shortcuts

Pro Tip: Start your Hermes agent inside a Tmux session. That way your agent stays online even if you close your laptop — reconnect anytime from anywhere.

4 Midnight Commander — File Management with a UI

Midnight Commander (MC) is a full-screen file manager for the terminal. It gives you a two-panel interface — think Norton Commander — so you can browse, copy, move, and edit files on your agent visually without memorizing shell commands.

Install Midnight Commander

If MC isn't already installed on your agent:

apt update && apt install mc -y

Launch MC

mc

You'll see two panels side by side showing your directory structure. Navigate with the arrow keys, select files with Insert, and use the function key menu at the bottom:

Copy Files Between Panels

This is where MC shines for your agent. Open one panel showing a local directory and the other showing a remote path — or use an SSH filesystem panel:

# From MC, press Ctrl+F then choose "Shell link"
# Enter: sh://root@<your-agent-ip>/root

Now you can copy files between your local machine and your agent by selecting them and pressing F5 — like dragging and dropping, but in the terminal.

Built-in Editor

Press F4 on any file to open MC's built-in editor (mcedit). It supports syntax highlighting, mouse support, and search — perfect for quick config edits on your agent without leaving the terminal.

Pro Tip: Enable mouse support in MC by pressing F9 → Options → Display → check "Mouse support". Now you can click to navigate, select files, and press function keys with your mouse — a full GUI feel over SSH.

5 Vim — Edit and Read Files on Your Agent

Vim is the default terminal editor on virtually every Linux system — including your agent. It's lightweight, runs entirely in the terminal, and once you learn the basics, it's the fastest way to edit configs, write scripts, or inspect log files on your agent.

Open a File

vim /path/to/file

If the file exists, Vim opens it for editing. If it doesn't, Vim creates a new file when you save.

Vim Modes — The Key Concept

Vim has several modes. You'll spend most of your time in two of them:

Essential Navigation (Normal Mode)

Essential Editing (Normal Mode)

Search and Replace

Save and Quit

Read Files Without Editing

If you just want to read a file — logs, configs, output — without risking accidental edits:

view /path/to/file

This opens Vim in read-only mode. You can navigate with all the same keys (j, k, gg, G, /search) but you can't make changes. Press :q to exit.

Pro Tip: Run vimtutor on your agent for an interactive 30-minute tutorial that teaches Vim hands-on. It's installed by default and walks you through every command at your own pace.

Deploy Your Agent with Full SSH Access

Every derez.ai agent gives you root SSH access, file sync, and all the tools you need to manage it your way.

Get Started →

derez.ai — Deploy your AI agent in 10 Minutes. · Blog · Focus Topics