key.rst 1.5 KB

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