Skip to content

mongoshield keygen

Generate an age key pair for encrypted backups.

Terminal window
mongoshield keygen [options]

The public recipient (age1…) goes in your config: backups only need it. The secret identity is needed to restore. Store a copy offline (password manager, printed in a safe): if it is lost, encrypted backups cannot be read.

OptionDescription
-o, --output <path>Write the identity to this file (mode 0600; never overwrites).

The global options (--config, --json, --quiet, --verbose, --no-color, --yes) work here too.

Create a key file:

Terminal window
mongoshield keygen --output backup.key

Use the public key for backups:

Terminal window
mongoshield backup --recipient age1…