Agent commands
All take --project, or the project from the active profile.
| Command | Does |
|---|---|
instances ssh <instance-id> |
Signs a short-lived certificate and opens SSH; through the agent with --tunnel or when there is no floating IP. |
instances run-command |
Runs a command on up to 100 instances and collects output and exit codes. |
instances port-forward <instance-id> |
Forwards a local TCP port to a port on the instance. |
instances sessions list <instance-id> |
Lists sessions opened into an instance. |
instances sessions describe <instance-id> <session-id> |
Shows one session. |
instances refresh-agent |
Re-installs the served agent build over the live channel. |
instances console-serial <instance-id> |
A single-use serial console URL, for when the agent is down. |
ssh-ca sign |
Signs your own public key into a short-lived certificate. |
ssh-ca trust-bundle |
Prints, or adds to known_hosts, the project’s host CA. |
ssh-ca describe |
The project’s CA keys and certificate limits. |
ssh-ca rotate-key |
Rotates the project’s CA keys. |
Examples
Section titled “Examples”# A shell, through the agentstratumctl instances ssh i-abc123 --tunnel --project p-web
# A shell with a port forward, passing options straight to sshstratumctl instances ssh i-abc123 --project p-web -- -L 8080:localhost:80
# Print the ssh command instead of running itstratumctl instances ssh i-abc123 --print --project p-web
# The same command on three instances, with a 2-minute timeoutstratumctl instances run-command --instances i-a,i-b,i-c \ --command "sudo dnf -y upgrade --security" --timeout 2m --project p-web
# A local port to the instance's web server; 0 picks a free local portstratumctl instances port-forward i-abc123 --local 0 --remote 80 --project p-web
# Sessions opened into an instance, as JSONstratumctl instances sessions list i-abc123 -o json --project p-web
# Refresh the agent on two instancesstratumctl instances refresh-agent --instances i-abc123,i-def456 --project p-web
# A 15-minute certificate for your own keystratumctl ssh-ca sign --public-key-file ~/.ssh/id_ed25519.pub --instance i-abc123 \ --valid-for 15m --out ~/.ssh/id_ed25519-cert.pub --project p-web
# Trust the project's host CA in known_hostsstratumctl ssh-ca trust-bundle --known-hosts --project p-web
# Rotate after a key compromise: the old key stops being trusted at oncestratumctl ssh-ca rotate-key --immediate --project p-webIAM actions
Section titled “IAM actions”| Action | Allows |
|---|---|
compute:StartInstanceSession |
Opening a shell or a tunnel. |
compute:RunCommand |
Run command. Held by project-editor and above. |
compute:PortForward |
Port forwarding. |
compute:DescribeInstance |
Listing and describing sessions. |
