key.rst 1.5 KB

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