2022-04-11 09:21:07 +00:00
|
|
|
.. include:: key_change-location.rst.inc
|
|
|
|
|
2017-06-06 22:06:36 +00:00
|
|
|
.. _borg-change-passphrase:
|
|
|
|
|
|
|
|
.. include:: key_change-passphrase.rst.inc
|
|
|
|
|
|
|
|
Examples
|
|
|
|
~~~~~~~~
|
|
|
|
::
|
|
|
|
|
|
|
|
# Create a key file protected repository
|
2022-08-03 16:46:50 +00:00
|
|
|
$ borg rcreate --encryption=keyfile-aes-ocb -v
|
2017-06-06 22:06:36 +00:00
|
|
|
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
|
2022-06-23 23:19:19 +00:00
|
|
|
$ borg key change-passphrase -v
|
2017-06-06 22:06:36 +00:00
|
|
|
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
|
|
|
|
|
2020-05-29 01:52:06 +00:00
|
|
|
# Import a previously-exported key into the specified
|
|
|
|
# key file (creating or overwriting the output key)
|
|
|
|
# (keyfile repositories only)
|
2022-06-23 23:19:19 +00:00
|
|
|
$ BORG_KEY_FILE=/path/to/output-key borg key import /path/to/exported
|
2020-05-29 01:52:06 +00:00
|
|
|
|
2017-06-06 22:06:36 +00:00
|
|
|
Fully automated using environment variables:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2023-01-16 16:58:50 +00:00
|
|
|
$ BORG_NEW_PASSPHRASE=old borg rcreate --encryption=repokey-aes-ocb
|
2017-06-06 22:06:36 +00:00
|
|
|
# now "old" is the current passphrase.
|
2022-06-23 23:19:19 +00:00
|
|
|
$ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change-passphrase
|
2017-06-06 22:06:36 +00:00
|
|
|
# now "new" is the current passphrase.
|
|
|
|
|
2017-06-20 09:53:36 +00:00
|
|
|
|
|
|
|
.. include:: key_export.rst.inc
|
|
|
|
|
2024-07-19 17:44:38 +00:00
|
|
|
Examples
|
|
|
|
~~~~~~~~
|
|
|
|
::
|
|
|
|
|
|
|
|
borg key export > encrypted-key-backup
|
|
|
|
borg key export --paper > encrypted-key-backup.txt
|
|
|
|
borg key export --qr-html > encrypted-key-backup.html
|
|
|
|
# Or pass the output file as an argument instead of redirecting stdout:
|
|
|
|
borg key export encrypted-key-backup
|
|
|
|
borg key export --paper encrypted-key-backup.txt
|
|
|
|
borg key export --qr-html encrypted-key-backup.html
|
|
|
|
|
2017-06-20 09:53:36 +00:00
|
|
|
.. include:: key_import.rst.inc
|