Skip to content

Reference

SSH reference ​

The ssh_exec tool, its permission target, its limits, and where its keys and hosts are kept.

ssh_exec ​

ArgumentRequiredMeaning
hostyesa host name or IPv4 address, with :port when not 22; IPv6 is not accepted
commandyesthe command line, run without a shell
asyesthe alias of an SSH key secret, such as vault/web-admin; its hosts must include host
timeoutnoseconds; default 60, at most 600

It returns the exit code, stdout and stderr. Each output is cut at the limit, with a line saying how much was not shown. A command past its timeout is killed.

The command ​

  • The words are run exactly as written, each quoted for the server's login shell.
  • Refused unquoted: ; | & > < $ ` * ? ~. A backslash is always refused.
  • A pipeline or a glob is an explicit sh -c '…'.
  • The words are scanned for stored secrets before they leave; a match refuses the command.

Checks, in order ​

StepCheckedKindChat default
1the command, as <user>@<host>[:port] <command>; the user is the key's loginsshask
2the host key: trusted, new or changedssh.hostkeyask, once; a changed key is refused
3using the key there, as <alias>@<host> on secret/<alias>secretask

Voice never has ssh_exec. An agent and a paired device have it off until you allow it; accepting an agent's request sets ask.

Patterns ​

[user@]host[:port] command, where the host follows the host rules (*.home.example covers the domain and its subdomains) and a * word in the command is any one word, or any number at the end. * alone is every command on every host. Wider suggestions on an approval: the command's first words plus * (never for sh -c, python3, sudo and other runners), or the same command on the parent domain.

Settings ​

VariableDefaultMeaning
NOCTURN_SSH_TIMEOUT1ma command's timeout when the call names none
NOCTURN_SSH_MAX_TIMEOUT10mthe longest timeout a call may name; not below NOCTURN_SSH_TIMEOUT
NOCTURN_SSH_MAX_OUTPUT65536 (64 KiB)bytes of stdout, and of stderr, per command

A login handshake and a host-key probe each have 30 seconds.

Files and commands ​

WhatWhere
keysvault/<name> in the workspace's vault.enc, or SSH key items of a Vaultwarden collection
trusted host keysnocturn-data/workspaces/<name>/ssh-hosts.json
add a keyExtensions › SSH › Add an SSH key, or nocturn secret set vault/<name> --ssh-user <user> --host <host>... < key
list hostsnocturn ssh hosts (ls)
forget a hostnocturn ssh forget <host> (rm), or Remove on its row

A key with a passphrase is refused; store a copy without one (ssh-keygen -p -N '' -f <copy>).

nocturn is open source. Example hosts and people on these pages are made up.