Register remote hosts as named SSH targets, hold their private keys encrypted, and route every outbound connection through the pks action guard.
pks ssh <command> [options]$ pks ssh register root@projects.si14agents.com -i ./id_rsaRegister a host as a named target
$ pks ssh key import --label hetzner --register root@1.2.3.4Import a private key and bind a target to it
$ pks ssh listShow every registered target
$ pks ssh connect pks-vm-2e93Open an interactive shell on a target
$ pks ssh run hetzner -- uname -aRun one command and stream its output
$ pks ssh copy ./build.tar hetzner:~/build.tarUpload a file to a target
pks ssh is the remote-access command group of the pks CLI: a local registry of named SSH targets, an optional encrypted store for the private keys those targets use, and a single gate that every outbound connection passes through.
pks ssh keeps a registry of the machines you reach over SSH — host, username, port, and either a key-file path or a pks-held key — at ~/.pks-cli/ssh-targets.json. After a host is registered, you address it by label instead of retyping connection details, and the same target is reusable by devcontainer-spawn and VM flows elsewhere in pks.
pks ssh register turns deploy@1.2.3.4 -p 2222 -i ./id_rsa into the label hetzner.pks ssh key import moves a private key into an AES-GCM-encrypted store, so no plaintext key sits in a path a coding agent can read and copy.connect, run, and copy all call the action guard under the action id ssh.connect, so an enrolled second factor stands between an agent and any outbound SSH session.register, list, and remove maintain the set of hosts pks knows about. Re-registering the same host, username, and port replaces the previous entry.key import, key list, and key remove manage keys at ~/.pks-cli/ssh-keys/. A held key is decrypted only into a short-lived 0600 temp file for the lifetime of one ssh or scp invocation.connect), a single streamed command (run), and file transfer (copy) — all resolving the target the same way.pks ssh run and pks ssh copy suppress the pks banner, so their stdout stays clean inside a shell pipeline.connect recognizes a target backed by a VM that pks vm tracks, offers to start it when it is stopped, and waits for SSH to come up.Registration is the only step that writes new state. pks ssh register records the connection details; pks ssh key import records key material and can register a bound target in the same call. Everything after that reads the registry: you name a target, pks resolves it to host, user, port, and identity, then shells out to the system ssh or scp binary with those values. No SSH library is involved — the local ssh, scp, and ssh-keygen binaries do the work.
The gate sits between resolution and execution. Before the process starts, connect, run, and copy call the action guard for ssh.connect. With no authenticator enrolled the guard passes through; once one is enrolled it demands the second factor, and a denial exits with the guard's message instead of connecting.
register, list, remove, key import, key list, key remove — no network, no gate.connect, run, copy — gated on ssh.connect every time.register · list · remove · connect · run · copy · key import · key list · key remove
Full argument and flag detail for every one of them is on the pks ssh reference.
| Setting | Value |
|---|---|
| Target registry | ~/.pks-cli/ssh-targets.json |
| Held-key store | ~/.pks-cli/ssh-keys/ |
| Key-encryption key | ~/.pks-cli/.ssh-keys-kek |
| SSH port | 22 |
Host-key checking (connect, run, copy) | -o StrictHostKeyChecking=no |
Host-key checking (register --test probe) | -o StrictHostKeyChecking=accept-new |
| Guarded action id | ssh.connect |
The pks ssh group reads no environment variables of its own; behavior is driven entirely by the registry, the key store, and the action-guard policy. See the pks ssh reference for the per-command detail.
Open an interactive shell on a registered SSH target, with stale pks VM entries pruned and a stopped Azure VM started before the session begins.
pks ssh connect [TARGET]
Move files and directories between your machine and a registered SSH target with scp, addressing the remote side as target:path instead of user@host.
pks ssh copy <SOURCE> <DEST> [options]
Import an SSH private key into the encrypted pks key store, list what is held, and remove keys, so targets connect without a plaintext key on disk.
pks ssh key <import|list|remove> [options]
Complete command, argument, flag, and file-path reference for the pks ssh group — target registry, encrypted key store, and the action-guard gate.
pks ssh <command> [options]
Add a remote host to the pks SSH registry with a label, port, and identity file, then address it by name from connect, run, and copy.
pks ssh register <user@host> [options]
Execute one non-interactive command on a registered SSH target with local stdin forwarded and remote output streamed straight through to your shell.
pks ssh run <TARGET> -- <command>