Skip to content

Quickstart

Run your first command ​

In this quickstart you add an SSH key for one server, trust the server's host key, and have the assistant run a command there. You need a running daemon with NOCTURN_MASTER_PASSPHRASE set, a phone on the home network, and a server you can log in to with a key.

1. Make a key for nocturn ​

Give nocturn a key of its own, without a passphrase (the vault encrypts it already), and allow it on the server:

sh
ssh-keygen -t ed25519 -N '' -C nocturn -f ~/.ssh/nocturn_web
ssh-copy-id -i ~/.ssh/nocturn_web.pub admin@web.home.example

2. Add it to nocturn ​

In the app, open Extensions, and under Built in tap SSH, then Add an SSH key:

FieldExample
Hostsweb.home.example (several separated by commas; a port after a colon)
Useradmin
Nameweb-admin; the secret becomes vault/web-admin
Private keythe contents of ~/.ssh/nocturn_web

Tap Add SSH key. The key appears under Keys, and the host under Hosts with host key asked at the first command. From the terminal instead:

sh
nocturn secret set vault/web-admin --ssh-user admin --host web.home.example < ~/.ssh/nocturn_web

3. Ask for a command ​

In a chat, send:

text
Is nginx running on web.home.example?

The first time, up to three questions come in turn:

  1. Run a command on web.home.example as admin? with Host, User, Command (systemctl status nginx) and Key. Leave Once and hold Hold to allow.
  2. Trust the SSH host key of web.home.example? with Key type and Fingerprint. Compare the fingerprint with the server's own (step 4), then hold Hold to allow.
  3. A question about using the key vault/web-admin on that host. Allow it.

The answer follows: the exit code and what the command printed.

4. Compare the fingerprint ​

On the server, print its host key's fingerprint and compare it with the sheet:

sh
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

They must be the same. If they are not, deny: something sits between nocturn and the server.

5. Check the trusted host ​

Back under Extensions › SSH, the host now shows its key type, fingerprint and trusted … ago. Its key is kept in the workspace; the next command to it asks only about the command.

Next steps ​

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