VM Access Guide
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.- 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:| Method | Command | Use Case |
|---|---|---|
| Interactive Shell | vers connect | Development, debugging, manual work |
| Execute Commands | vers execute | Automation, scripts, CI/CD |
| File Transfer | vers copy | Upload/download files and directories |
Interactive Shell (vers connect)
Open a full terminal session to your VM: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
Typeexit or press Ctrl+D to disconnect. Your VM keeps running.
Executing Commands (vers execute)
Run commands without an interactive session:Use Cases
Running tests: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:SSH Key Management
Vers automatically manages SSH keys for you:- First connection: CLI fetches your VM’s private key from the API
- Local caching: Key stored at
/tmp/vers-ssh-keys/{vm-id}.key - Secure permissions: Keys have 0600 permissions (owner read/write only)
- Automatic authentication: Key used for all subsequent connections
Key Storage Location
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:Multiple VM Workflows
Parallel Development
Test Isolation
Troubleshooting
Connection Refused
VM Not Running
vers resume
SSH Key Errors
vers login to re-authenticate
Timeout
vers status
Security Best Practices
- Keys are temporary: SSH keys are stored in
/tmpand may be cleared on reboot - Per-VM isolation: Each VM has its own unique key
- No key sharing: Don’t copy or share VM SSH keys
- 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 thewithSSH 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
See Also
- vers connect - Interactive SSH sessions
- vers execute - Run commands on VMs
- vers copy - Transfer files
- Quickstart - Get started with Vers