borg-key-change-passphrase(1)

borg-key-change-passphrase1

Change repository key file passphrase

Usage

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

Overview

The key files used for repository encryption are optionally passphrase- protected. This command can be used to change this passphrase.

Please note that this command only changes the passphrase, but not any secret protected by it (e.g., encryption/MAC keys or the chunker seed). Thus, changing the passphrase after the passphrase and Borg key were compromised does not protect future (nor past) backups to the same repository.

Options

See borg-common(1) for common options of Borg commands.

arguments

REPOSITORY

Examples

# 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

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.

Releases

5 releases since Debian 10 (Buster); the text changed 4 times.

  1. 10
  2. 11
  3. 12
  4. 13
  5. Arch

Author

The Borg Collective

From borg 1.4.5-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.