Remote Access (SSH)
SSH access lets you connect directly to running Valohai executions for interactive debugging, IDE attachment, and real-time inspection.
Why use SSH debugging:
Attach your local IDE (VS Code, PyCharm) to debug code running on cloud infrastructure
Inspect execution state interactively without stopping the job
Tunnel to services like TensorBoard for real-time monitoring
Test code changes directly in the execution environment
Requirements
SSH access requires:
Enterprise plan with on-premises, AWS, Azure, or GCP environments
Firewall configuration by your organization administrator
SSH key pair for authentication
SSH connects to the Docker container running your code, not the underlying VM. This means Valohai internals and the host OS are not accessible.
Quick Start
For Developers
Generate SSH keys (or use auto-generated keys)
Start execution with "Run with SSH" enabled
Wait for IP address in logs
Connect using SSH or your IDE
Choose your debugging approach:
VS Code Remote Debugging - debugpy integration
PyCharm Remote Debugging - PyCharm Professional debugger
Direct SSH connection (terminal access)
Alternative for Kubernetes users:
Kubernetes Shell Access - kubectl-based debugging (no SSH keys required)
For Administrators
Before developers can use SSH, complete the one-time setup below.
Administrator Setup
Generate SSH Keys
You can auto-generate keys in the Valohai UI or create them manually.
Start an Execution with SSH
From Web UI
Create or open an execution
Enable Run with SSH
Paste your public key (or auto-generate)
Adjust TCP/IP port if needed (default uses organization setting)
Click Create Execution

From Command Line
vh exec run --adhoc \
--debug-key-file=/path/to/your-key.pub \
--debug-port 2222 \
trainConnect to Your Execution
1. Wait for IP Address
After starting the execution, watch the logs for the connection details:

The log will show:
SSH connection available at: 52.214.159.193:2222💡 If you don't see the IP, ensure SSH was enabled when starting the execution.
2. Keep Execution Running
Important: Executions shut down when the command finishes. Add a sleep to keep it alive:
- step:
name: train
command:
- python train.py {parameters}
- sleep 1h # Keeps execution alive for debuggingWhy 1 hour? Setting a reasonable timeout prevents costly mistakes from infinite runtimes.
For IDE debugging, use debugger wait patterns (see VS Code or PyCharm guides) instead of sleep.
3. Choose Connection Method
Interactive Shell
ssh -i /path/to/private-key <IP> -p 2222 -t /bin/bashThis opens a bash session inside your execution container.
Run Single Command
ssh -i /path/to/private-key <IP> -p 2222 -t ps auxReturns command output to your terminal.
SSH Tunnel (for services like TensorBoard)
ssh -i /path/to/private-key <IP> -p 2222 -L 5678:127.0.0.1:5678Forwards port 5678 from the execution to your local machine.
Next Steps
Debug with your IDE:
Alternative for Kubernetes:
Kubernetes Shell Access - No SSH keys needed
Common Issues
No IP address in logs?
Verify SSH was enabled when starting the execution
Check that you pasted the public key (not private key)
Connection refused?
Confirm firewall rules allow traffic on your debug port
Verify the port matches your organization settings
Authentication failed?
Ensure you're using the private key (not
.pubfile)Check file permissions:
chmod 600 /path/to/private-key
Execution shuts down too quickly?
Add
sleep 1hat the end of your commandFor IDE debugging, use debugger wait patterns
Last updated
Was this helpful?
