vers connect
Connect to a running VM via SSH for interactive access.Synopsis
Description
Theconnect command opens an SSH session to a running VM, giving you full interactive access to the VM’s terminal. The command automatically handles SSH key management and secure connection routing.
Basic Usage
Connect to Current HEAD VM
Connect to Specific VM
How Connections Work
Vers uses SSH-over-TLS for secure connections:- TLS Connection: Establishes encrypted TLS connection to
{vm-id}.vm.vers.shon port 443 - SSH Handshake: Performs SSH authentication over the TLS tunnel
- Interactive Session: Opens a full PTY terminal session
- Uses standard HTTPS port (443) - no firewall issues
- Provides double encryption (TLS + SSH)
- Automatically handles routing to your VM
SSH Key Management
The CLI automatically handles SSH authentication:- Key Retrieval: Fetches your VM’s SSH private key from the Vers API
- Local Caching: Stores keys at
/tmp/vers-ssh-keys/{vm-id}.keywith secure permissions (0600) - Automatic Auth: Uses the key for public key authentication as
rootuser
What You’ll See
Successful Connection
Requirements
VM Must Be Running
vers resume or check its status with vers status.
Examples
Basic Development Workflow
Working with Multiple VMs
Custom Host Override
SSH Session Features
Full Interactive Access
Once connected, you have complete root access to the VM:Terminal Support
- Full PTY (pseudo-terminal) support
- Terminal resize handling - window resizes are reflected in the VM
- Color and formatting support (xterm-256color)
Multiple Sessions
You can open multiple SSH sessions to the same VM:Persistent State
VMs maintain their state between connections:- Running processes continue when you disconnect
- Files and changes are preserved
- Environment variables and configurations persist
Connection Keep-Alive
The SSH connection uses automatic keep-alive to maintain stable connections:- Sends keep-alive every 10 seconds
- Tolerates up to 6 missed responses before disconnecting
- Helps maintain connections over unreliable networks
Exiting the Session
To disconnect from the VM:Ctrl+D to exit the SSH session. The VM continues running.
Flags
--host
Override the connection host for custom network configurations:
- Custom network routing
- Internal network configurations
- Testing different connection paths
Error Scenarios
VM Not Found
vers status or verify the VM ID/alias.
VM Not Running
vers resume.
SSH Key Issues
vers login and ensure you have proper access.
Connection Timeout
Connection Security
Vers SSH connections are secure:- SSH-over-TLS: All traffic encrypted twice (TLS layer + SSH layer)
- Port 443: Uses standard HTTPS port, works through most firewalls
- Public key authentication: No passwords - keys are managed automatically
- Per-VM keys: Each VM has its own unique SSH key
- Secure key storage: Keys stored with 0600 permissions (owner read/write only)
Tips
- VMs continue running when you disconnect - your work is preserved
- You can connect to the same VM from multiple terminals simultaneously
- Use
vers statusto check VM states before connecting - SSH keys are automatically managed - no manual setup required
- Use
vers executefor single commands without an interactive session
See Also
- vers status - Check VM states and availability
- vers execute - Run single commands without interactive session
- vers copy - Transfer files to/from VMs
- vers checkout - Switch between VMs
- vers pause / vers resume - Control VM states