borg-key-change-passphrase(1)

✨ borg-key-change-passphrase(1) ✨

okay bestie, welcome to the borg backup tool manual page for borg-key-change-passphrase β€” yeah it's a long name, she's a lot, but she's worth it πŸ’…


πŸ’– NAME πŸ’–

borg-key-change-passphrase β€” change repository key file passphrase πŸ”‘


🌸 SYNOPSIS 🌸

borg [common options] key change-passphrase [options] [REPOSITORY]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” the key files that Borg uses for repository encryption are optionally passphrase-protected. Meaning: if you want, they can have a passphrase. This command is the one you run when you wanna change that passphrase. simple as that, periodt.

Please note that this command only changes the passphrase, but not any secret that's protected by it (e.g., encryption/MAC keys or the chunker seed). So like… if your passphrase and your Borg key were compromised? changing the passphrase afterwards does not protect future (nor past) backups to the same repository. no cap. it's giving "locking the door after the house is already gone" 😭


✨ OPTIONS ✨

See borg-common(1) for common options of Borg commands. (that's where all the shared stuff lives, go peek πŸ‘€)

πŸŽ€ arguments

  • REPOSITORY

🌈 EXAMPLES 🌈

fr fr let's run it:

# Create a key file protected repository
$ borg init --encryption=keyfile -v /path/to/repo
Initializing repository at "/path/to/repo"
Enter new passphrase:
Enter same passphrase again:
Remember your passphrase. Your data will be inaccessible without it.
Key in "/root/.config/borg/keys/mnt_backup" created.
Keep this key safe. Your data will be inaccessible without it.
Synchronizing chunks cache...
Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0.
Done.

# Change key file passphrase
$ borg key change-passphrase -v /path/to/repo
Enter passphrase for key /root/.config/borg/keys/mnt_backup:
Enter new passphrase:
Enter same passphrase again:
Remember your passphrase. Your data will be inaccessible without it.
Key updated

# Import a previously-exported key into the specified
# key file (creating or overwriting the output key)
# (keyfile repositories only)
$ BORG_KEY_FILE=/path/to/output-key borg key import /path/to/repo /path/to/exported

and if you're feeling ✨automated✨, fully automated using environment variables:

$ BORG_NEW_PASSPHRASE=old borg init -e=repokey repo
# now "old" is the current passphrase.
$ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change-passphrase repo
# now "new" is the current passphrase.

πŸ‘‘ SEE ALSO πŸ‘‘

borg-common(1)


πŸ’œ Author πŸ’œ

The Borg Collective 🌟


and that's the whole page!! go change that passphrase, bestie 🫢

borg backup tool Β· 2026-07-18 Β· borg-key-change-passphrase(1) β€” mwah, see u next manpage πŸ’‹βœ¨

πŸ“¦ where this page comes from