Skip to main content
This guide covers how to interact with your Vers VMs — connecting via SSH, executing commands, and transferring files.

Connection Architecture

Vers uses SSH-over-TLS for all VM connections. This means your SSH traffic is tunneled through a TLS connection on port 443.
Benefits:
  • Works through corporate firewalls (uses HTTPS port 443)
  • Double encryption (TLS + SSH)
  • No need to expose SSH ports
  • Automatic routing to your specific VM

Ways to Access Your VM

Vers provides three main ways to interact with VMs:

Interactive Shell (vers connect)

Open a full terminal session to your VM:
Once connected, you have full root access:

Terminal Features

  • Full PTY support: Run vim, htop, or any interactive program
  • Terminal resizing: Window size changes are reflected in the VM
  • Color support: Full xterm-256color terminal
  • Multiple sessions: Connect from multiple terminals simultaneously

Exiting

Type exit or press Ctrl+D to disconnect. Your VM keeps running.

Executing Commands (vers execute)

Run commands without an interactive session:
Output is captured and returned to your terminal. Exit codes are preserved.

Use Cases

Running tests:
Automation scripts:
Checking status:

File Transfer (vers copy)

Transfer files between your machine and VMs using SCP:

Path Detection

The CLI automatically detects transfer direction:
  • Paths starting with / are treated as remote (VM) paths
  • Other paths are treated as local paths
  • If ambiguous, the CLI checks if a local file exists

Examples

Deploy code to VM:
Download logs:
Backup database:

SSH Key Management

Vers automatically manages SSH keys for you:
  1. First connection: CLI fetches your VM’s private key from the API
  2. Local caching: Key stored at /tmp/vers-ssh-keys/{vm-id}.key
  3. Secure permissions: Keys have 0600 permissions (owner read/write only)
  4. Automatic authentication: Key used for all subsequent connections
You never need to manually configure SSH keys.

Key Storage Location

Keys are cached per-VM and reused across connections.

Connection Details

Authentication

  • Username: Always root
  • Method: Public key authentication (no passwords)
  • Keys: Per-VM keys, automatically managed

Network

  • Host: {vm-id}.vm.vers.sh
  • Port: 443 (TLS)
  • Protocol: SSH tunneled over TLS

Keep-Alive

Connections use automatic keep-alive:
  • Interval: 10 seconds
  • Max missed: 6 (disconnects after ~60 seconds of no response)

Working with HEAD

Many commands work with your current HEAD VM by default:
Check your current HEAD:

Multiple VM Workflows

Parallel Development

Test Isolation

Troubleshooting

Connection Refused

Cause: VM may still be starting up Solution: Wait a few seconds and retry

VM Not Running

Solution: Resume the VM with vers resume

SSH Key Errors

Cause: Authentication issue Solution: Run vers login to re-authenticate

Timeout

Cause: Network issues or VM unavailable Solution: Check your internet connection; verify VM exists with vers status

Security Best Practices

  1. Keys are temporary: SSH keys are stored in /tmp and may be cleared on reboot
  2. Per-VM isolation: Each VM has its own unique key
  3. No key sharing: Don’t copy or share VM SSH keys
  4. Session logging: Your commands run as root - be careful with destructive operations

TypeScript SDK Access

For programmatic VM access, the Vers TypeScript SDK provides full SSH functionality through the withSSH wrapper.

Setup

Execute Commands

Run commands and capture output:

Streaming Output

For long-running commands, stream output in real-time:

File Transfer (SFTP)

Upload and download files:

Interactive Shell Sessions

Open an interactive terminal:

Reusable Connections

For multiple operations, reuse a single SSH connection:

Connection Options

All SSH methods accept options for timeouts, retries, and cancellation:

SSH Key Caching

The SDK caches SSH keys in memory for efficiency:

Waiting for SSH Availability

After creating a VM, wait for SSH to become available:

Complete Example

What’s next

vers connect

Interactive SSH sessions — every flag and option.

vers execute

Run one-off commands on a VM without an interactive session.

vers copy

Transfer files between your machine and any VM.

Architecture

How the SSH, exec, and proxy layers actually work.