init.rst.inc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. borg:command:: borg init
  3. .. _borg_init:
  4. borg init
  5. ---------
  6. ::
  7. borg [common options] init <options> REPOSITORY
  8. positional arguments
  9. REPOSITORY
  10. repository to create
  11. optional arguments
  12. ``-e``, ``--encryption``
  13. | select encryption key mode **(required)**
  14. ``-a``, ``--append-only``
  15. | create an append-only mode repository
  16. `Common options`_
  17. |
  18. Description
  19. ~~~~~~~~~~~
  20. This command initializes an empty repository. A repository is a filesystem
  21. directory containing the deduplicated data from zero or more archives.
  22. Encryption can be enabled at repository init time. It cannot be changed later.
  23. It is not recommended to work without encryption. Repository encryption protects
  24. you e.g. against the case that an attacker has access to your backup repository.
  25. But be careful with the key / the passphrase:
  26. If you want "passphrase-only" security, use one of the repokey modes. The
  27. key will be stored inside the repository (in its "config" file). In above
  28. mentioned attack scenario, the attacker will have the key (but not the
  29. passphrase).
  30. If you want "passphrase and having-the-key" security, use one of the keyfile
  31. modes. The key will be stored in your home directory (in .config/borg/keys).
  32. In the attack scenario, the attacker who has just access to your repo won't
  33. have the key (and also not the passphrase).
  34. Make a backup copy of the key file (keyfile mode) or repo config file
  35. (repokey mode) and keep it at a safe place, so you still have the key in
  36. case it gets corrupted or lost. Also keep the passphrase at a safe place.
  37. The backup that is encrypted with that key won't help you with that, of course.
  38. Make sure you use a good passphrase. Not too short, not too simple. The real
  39. encryption / decryption key is encrypted with / locked by your passphrase.
  40. If an attacker gets your key, he can't unlock and use it without knowing the
  41. passphrase.
  42. Be careful with special or non-ascii characters in your passphrase:
  43. - Borg processes the passphrase as unicode (and encodes it as utf-8),
  44. so it does not have problems dealing with even the strangest characters.
  45. - BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
  46. So better use a long passphrase made from simple ascii chars than one that
  47. includes non-ascii stuff or characters that are hard/impossible to enter on
  48. a different keyboard layout.
  49. You can change your passphrase for existing repos at any time, it won't affect
  50. the encryption/decryption key or other secrets.
  51. Encryption modes
  52. ++++++++++++++++
  53. `repokey` and `keyfile` use AES-CTR-256 for encryption and HMAC-SHA256 for
  54. authentication in an encrypt-then-MAC (EtM) construction. The chunk ID hash
  55. is HMAC-SHA256 as well (with a separate key).
  56. These modes are compatible with borg 1.0.x.
  57. `repokey-blake2` and `keyfile-blake2` are also authenticated encryption modes,
  58. but use BLAKE2b-256 instead of HMAC-SHA256 for authentication. The chunk ID
  59. hash is a keyed BLAKE2b-256 hash.
  60. These modes are new and *not* compatible with borg 1.0.x.
  61. `authenticated` mode uses no encryption, but authenticates repository contents
  62. through the same keyed BLAKE2b-256 hash as the other blake2 modes (it uses it
  63. as the chunk ID hash). The key is stored like repokey.
  64. This mode is new and *not* compatible with borg 1.0.x.
  65. `none` mode uses no encryption and no authentication. It uses sha256 as chunk
  66. ID hash. Not recommended, rather consider using an authenticated or
  67. authenticated/encrypted mode.
  68. This mode is compatible with borg 1.0.x.
  69. Hardware acceleration will be used automatically.
  70. On modern Intel/AMD CPUs (except very cheap ones), AES is usually
  71. hardware-accelerated. BLAKE2b is faster than SHA256 on Intel/AMD 64bit CPUs,
  72. which makes `authenticated` faster than `none`.
  73. On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster
  74. than BLAKE2b-256 there.