Skip to main content
This command is marked as unstable and may change in future releases.

Command: phala ssh

Syntax

phala ssh [options] [<cvm-name>] [--] [...]

Description

Connect to a CVM via SSH

Arguments

ArgumentDescription
<cvm-name>?CVM name. If not provided, reads from phala.toml

Options

OptionDescription
-h, --helpShow help information for the current command
-v, --versionShow CLI version
-p, --port <value>Gateway port. Priority: CLI option > phala.toml gateway_port > 443
-g, --gateway <value>Gateway domain. Priority: CLI option > phala.toml gateway_domain > API. When specified, skips API call for offline usage
-t, --timeout <value>Connection timeout in seconds (default: 30)
-v, --verboseShow verbose connection details
--dry-runPrint the SSH command without executing it

Pass-through Arguments

All arguments after — are passed directly to ssh. Common options: -i (identity file), -L (local forward), -R (remote forward), -D (SOCKS proxy), -N (no command), -v (ssh verbose). Any trailing arguments are executed as remote command. Note: -o ProxyCommand is blocked.

Examples

  • Connect using configuration from phala.toml
phala ssh
  • Connect to a specific CVM (queries API for gateway)
phala ssh app_123
  • Offline mode: connect without API (using phala.toml gateway)
phala ssh app_123 -g dstack-prod5.phala.network -p 16185
  • Connect with custom SSH key
phala ssh app_123 -- -i ~/.ssh/custom_key
  • Forward local port 8080 to remote port 80
phala ssh app_123 -- -L 8080:localhost:80
  • SOCKS proxy without remote command
phala ssh app_123 -- -D 1080 -N
  • Execute remote command
phala ssh app_123 -- ls -la /app
  • Connect with verbose output for debugging
phala ssh app_123 -v
  • Print the SSH command without executing
phala ssh app_123 --dry-run -- -L 8080:localhost:80