key.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .. include:: key_change-location.rst.inc
  2. .. _borg-change-passphrase:
  3. .. include:: key_change-passphrase.rst.inc
  4. Examples
  5. ~~~~~~~~
  6. ::
  7. # Create a key file protected repository
  8. $ borg repo-create --encryption=keyfile-aes-ocb -v
  9. Initializing repository at "/path/to/repo"
  10. Enter new passphrase:
  11. Enter same passphrase again:
  12. Remember your passphrase. Your data will be inaccessible without it.
  13. Key in "/root/.config/borg/keys/mnt_backup" created.
  14. Keep this key safe. Your data will be inaccessible without it.
  15. Synchronizing chunks cache...
  16. Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0.
  17. Done.
  18. # Change key file passphrase
  19. $ borg key change-passphrase -v
  20. Enter passphrase for key /root/.config/borg/keys/mnt_backup:
  21. Enter new passphrase:
  22. Enter same passphrase again:
  23. Remember your passphrase. Your data will be inaccessible without it.
  24. Key updated
  25. # Import a previously-exported key into the specified
  26. # key file (creating or overwriting the output key)
  27. # (keyfile repositories only)
  28. $ BORG_KEY_FILE=/path/to/output-key borg key import /path/to/exported
  29. Fully automated using environment variables:
  30. ::
  31. $ BORG_NEW_PASSPHRASE=old borg repo-create --encryption=repokey-aes-ocb
  32. # now "old" is the current passphrase.
  33. $ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change-passphrase
  34. # now "new" is the current passphrase.
  35. .. include:: key_export.rst.inc
  36. Examples
  37. ~~~~~~~~
  38. ::
  39. borg key export > encrypted-key-backup
  40. borg key export --paper > encrypted-key-backup.txt
  41. borg key export --qr-html > encrypted-key-backup.html
  42. # Or pass the output file as an argument instead of redirecting stdout:
  43. borg key export encrypted-key-backup
  44. borg key export --paper encrypted-key-backup.txt
  45. borg key export --qr-html encrypted-key-backup.html
  46. .. include:: key_import.rst.inc