Skip to main content

Default behavior

When you create your first VM, the CLI registers your local public key (~/.ssh/id_rsa.pub) as a public key and sets it as your default. Your private key never leaves your machine.

Key types

machine0 supports two key types:

Public keys (bring your own)

Register an existing public key from your machine:
machine0 keys new my-key --type PUBLIC --publicKeyPath ~/.ssh/id_ed25519.pub
Your private key stays on your machine. machine0 only stores the public half.

Managed keys (server-generated)

Generate a keypair on the server and download the private key:
machine0 keys new my-key --type MANAGED
The private key is saved to ~/.ssh/machine0__my-key (permissions 0600). The public key is saved alongside it.
Managed private keys can only be downloaded once at creation time. If you lose the local copy, you’ll need to create a new key.

Setting a default key

Set any key as the default for new VMs:
machine0 keys new my-key --type MANAGED --default
Or update an existing key:
machine0 keys update my-key --default true

Managing keys

List all keys:
machine0 keys ls
┌────────────────────────────────────────────────────────┐
│ Name                                Type       Default │
│ barnaby@Barnabys-MBP.localdomain    PUBLIC     *       │
└────────────────────────────────────────────────────────┘
Get key details:
machine0 keys get my-key
Delete a key:
machine0 keys rm my-key