ssh-key — account
keys and HTTPS tokens
ssh |
chroot.dev ssh-key list |
ssh |
chroot.dev ssh-key add
[--ci [--from
name]] [key] |
ssh |
chroot.dev ssh-key rm
key |
ssh |
chroot.dev ssh-key generate-api-key
[--cmds list]
[--escalate] [--exp
time] [--label
label] [--vm
name] |
list
- Keys of the account.
add
[key]
- Add a public key; without key, read it from standard
input. The key is not added yet: the answer is a challenge to sign with
its private key within 15 minutes, with exit status 1. The signature, on
standard input, adds it; see
account(7).
‘
github:user’
or
‘sourcehut:~user’
asks for the public keys of that account, each signed the same way, only
on the account that signed up with it. A key already registered, on any
account, is refused. RSA keys are refused.
--ci
- Add a restricted key, for CI. Its ssh login may run only
new, cp,
rm, stat,
log, ls and
ssh, besides help and
status, and reaches only the VMs it created:
ls lists those, ‘ssh
vm+name@chroot.run’ reaches those,
cp copies those and the
--from templates, and any other VM of the
account is denied. new
--integration is denied. Tokens it signs are
refused. It never goes into the authorized_keys of a VM, its own
included, and integrations attached to
‘all’ do not reach its VMs; one
attached to
‘vm:name’
does.
--from
name
- With
--ci: a VM the key may also
cp from, a template; repeatable.
--ci and
--from go with the public key, not with the
signature, and not with the keys of a GitHub or SourceHut account. A
key's restriction cannot be changed: add a new key with
--ci and remove the old one.
rm
key
- Remove a key by fingerprint or the key itself, or by comment: every key
with that comment. The last key that logs in is not removed while only
token keys or keys added with
--ci would remain. A
removed key stays in the authorized_keys of the VMs created while it was
in the account, and of their copies. Any removal also logs the account out
of every browser; see browser(1).
Within about a minute, ssh connections open with a removed key end, and so
do websockets and other upgraded HTTPS connections opened with its tokens
or with those browser sessions.
generate-api-key
- Create a key and print a token for it:
--cmds
list
- Comma-separated commands the token may run, with their subcommand, by
full name: ‘
ls’,
‘ssh-key list’,
‘ssh-key remove’,
‘share show’,
‘integrations list’; short forms
such as ‘ssh-key rm’ or
‘int list’ are refused. A list
with spaces is quoted for the remote side too:
‘--cmds "'ls,ssh-key
list'"’.
‘billing’ only shows the plan;
‘billing plans’,
‘billing subscribe’,
‘billing portal’ and
‘billing cap’ are each named on
their own. ‘ssh
name’ runs commands in that VM
only. A name that is not a command is refused. The default only reads:
help, ls, whoami, ssh-key list and share show.
--escalate
- Allow in
--cmds the commands that give more
than the token: ‘ssh’ (every
VM), ‘ssh-key add’,
‘ssh-key generate-api-key’ and
‘browser’.
‘ssh-key add’ also needs
--exp
‘never’: the keys it adds do not
expire.
--exp
time
- Validity: a number followed by
‘
s’,
‘m’,
‘h’,
‘d’,
‘w’ or
‘y’, for seconds, minutes,
hours, days, weeks or years of 365 days, as in
‘12h’ or
‘30d’, the default; or
‘never’. Zero is refused, and it
may not end after January 1, 2100. A token made over
/exec by another token expires with it at the
latest, ‘never’ included; so do
the browser sessions of its
‘browser’ link.
--label
label
- Comment of the key, used to revoke it. The default is
‘
api’.
--vm
name
- A token for the HTTPS of that VM instead of
/exec, sent to
https://name.chroot.run
as ‘
Authorization: Bearer’,
‘X-Fcm-Authorization: Bearer’ or
the Basic password. Not valid with --cmds. It
holds for that VM only: a new VM with the same name refuses it, and so
does the VM after rename. VM tokens made
before October 9, 2026 are refused; make new ones.
$ ssh chroot.dev ssh-key add < id_laptop.pub
laptop$ echo NONCE |
ssh-keygen -Y sign -n add-key@chroot.dev -f ~/.ssh/id_laptop >sig
$ ssh chroot.dev ssh-key add < sig
$ ssh chroot.dev ssh-key generate-api-key --label ci --exp 30d
$ ssh chroot.dev ssh-key rm ci