DocsConnect with SSH
v1.16+

Connect with SSH

SSH access lets you use regular local developer tools against a service run with plugins.ssh enabled. Use it for terminal access, IDE remote development, SFTP, SCP, port forwarding, and rsync when the container image includes it.

This page continues from the Sandbox Quick Start and uses its quick-start project and RUN_UUID variable. The component created there already enables SSH.

Enable SSH

Enable the SSH plugin on a service run:

plugins:
  ssh: true

run:
  kind: service
  container:
    image: python:3.11
    command: ["sleep", "infinity"]

Prepare SSH Access

Run setup once for the target run:

polyaxon ssh setup -p quick-start -uid $RUN_UUID

Polyaxon manages the default sandbox key and known hosts file unless you provide explicit files.

Connect

polyaxon ssh connect -p quick-start -uid $RUN_UUID

You can pass standard SSH options after --:

polyaxon ssh connect -p quick-start -uid $RUN_UUID -- -L 8888:127.0.0.1:8888 -N

Use Your SSH Client

Print a config block and add it to your SSH config:

polyaxon ssh config -p quick-start -uid $RUN_UUID

Then connect with your local client:

ssh polyaxon-$RUN_UUID

The generated host can also be used by IDEs and file-transfer tools that support SSH config entries.

Reference

See the SSH CLI reference for all options.