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 π
π 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
- alpine 3.24: borgbackup-doc 1.4.5-r0 Β· BSD-3-Clause
- arch rolling: borg 1.4.5-1 Β· BSD
- ubuntu stonking: borgbackup 1.4.5-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms