borg-rcreate.1 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "BORG-RCREATE" 1 "2022-06-25" "" "borg backup tool"
  31. .SH NAME
  32. borg-rcreate \- Create a new, empty repository
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] rcreate [options]
  36. .SH DESCRIPTION
  37. .sp
  38. This command creates a new, empty repository. A repository is a filesystem
  39. directory containing the deduplicated data from zero or more archives.
  40. .SS Encryption mode TLDR
  41. .sp
  42. The encryption mode can only be configured when creating a new repository \- you can
  43. neither configure it on a per\-archive basis nor change the mode of an existing repository.
  44. This example will likely NOT give optimum performance on your machine (performance
  45. tips will come below):
  46. .INDENT 0.0
  47. .INDENT 3.5
  48. .sp
  49. .nf
  50. .ft C
  51. borg rcreate \-\-encryption repokey\-aes\-ocb
  52. .ft P
  53. .fi
  54. .UNINDENT
  55. .UNINDENT
  56. .sp
  57. Borg will:
  58. .INDENT 0.0
  59. .IP 1. 3
  60. Ask you to come up with a passphrase.
  61. .IP 2. 3
  62. Create a borg key (which contains some random secrets. See \fIkey_files\fP).
  63. .IP 3. 3
  64. Derive a "key encryption key" from your passphrase
  65. .IP 4. 3
  66. Encrypt and sign the key with the key encryption key
  67. .IP 5. 3
  68. Store the encrypted borg key inside the repository directory (in the repo config).
  69. This is why it is essential to use a secure passphrase.
  70. .IP 6. 3
  71. Encrypt and sign your backups to prevent anyone from reading or forging them unless they
  72. have the key and know the passphrase. Make sure to keep a backup of
  73. your key \fBoutside\fP the repository \- do not lock yourself out by
  74. "leaving your keys inside your car" (see \fIborg_key_export\fP).
  75. For remote backups the encryption is done locally \- the remote machine
  76. never sees your passphrase, your unencrypted key or your unencrypted files.
  77. Chunking and id generation are also based on your key to improve
  78. your privacy.
  79. .IP 7. 3
  80. Use the key when extracting files to decrypt them and to verify that the contents of
  81. the backups have not been accidentally or maliciously altered.
  82. .UNINDENT
  83. .SS Picking a passphrase
  84. .sp
  85. Make sure you use a good passphrase. Not too short, not too simple. The real
  86. encryption / decryption key is encrypted with / locked by your passphrase.
  87. If an attacker gets your key, he can\(aqt unlock and use it without knowing the
  88. passphrase.
  89. .sp
  90. Be careful with special or non\-ascii characters in your passphrase:
  91. .INDENT 0.0
  92. .IP \(bu 2
  93. Borg processes the passphrase as unicode (and encodes it as utf\-8),
  94. so it does not have problems dealing with even the strangest characters.
  95. .IP \(bu 2
  96. BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
  97. .UNINDENT
  98. .sp
  99. So better use a long passphrase made from simple ascii chars than one that
  100. includes non\-ascii stuff or characters that are hard/impossible to enter on
  101. a different keyboard layout.
  102. .sp
  103. You can change your passphrase for existing repos at any time, it won\(aqt affect
  104. the encryption/decryption key or other secrets.
  105. .SS Choosing an encryption mode
  106. .sp
  107. Depending on your hardware, hashing and crypto performance may vary widely.
  108. The easiest way to find out about what\(aqs fastest is to run \fBborg benchmark cpu\fP\&.
  109. .sp
  110. \fIrepokey\fP modes: if you want ease\-of\-use and "passphrase" security is good enough \-
  111. the key will be stored in the repository (in \fBrepo_dir/config\fP).
  112. .sp
  113. \fIkeyfile\fP modes: if you rather want "passphrase and having\-the\-key" security \-
  114. the key will be stored in your home directory (in \fB~/.config/borg/keys\fP).
  115. .sp
  116. The following table is roughly sorted in order of preference, the better ones are
  117. in the upper part of the table, in the lower part is the old and/or unsafe(r) stuff:
  118. .\" nanorst: inline-fill
  119. .
  120. .TS
  121. center;
  122. |l|l|l|l|l|.
  123. _
  124. T{
  125. Mode (K = keyfile or repokey)
  126. T} T{
  127. ID\-Hash
  128. T} T{
  129. Encryption
  130. T} T{
  131. Authentication
  132. T} T{
  133. V >=
  134. T}
  135. _
  136. T{
  137. K\-blake2\-chacha20\-poly1305
  138. T} T{
  139. BLAKE2b
  140. T} T{
  141. CHACHA20
  142. T} T{
  143. POLY1305
  144. T} T{
  145. 2.0
  146. T}
  147. _
  148. T{
  149. K\-chacha20\-poly1305
  150. T} T{
  151. HMAC\-SHA\-256
  152. T} T{
  153. CHACHA20
  154. T} T{
  155. POLY1305
  156. T} T{
  157. 2.0
  158. T}
  159. _
  160. T{
  161. K\-blake2\-aes\-ocb
  162. T} T{
  163. BLAKE2b
  164. T} T{
  165. AES256\-OCB
  166. T} T{
  167. AES256\-OCB
  168. T} T{
  169. 2.0
  170. T}
  171. _
  172. T{
  173. K\-aes\-ocb
  174. T} T{
  175. HMAC\-SHA\-256
  176. T} T{
  177. AES256\-OCB
  178. T} T{
  179. AES256\-OCB
  180. T} T{
  181. 2.0
  182. T}
  183. _
  184. T{
  185. K\-blake2
  186. T} T{
  187. BLAKE2b
  188. T} T{
  189. AES256\-CTR
  190. T} T{
  191. BLAKE2b
  192. T} T{
  193. 1.1
  194. T}
  195. _
  196. T{
  197. K
  198. T} T{
  199. HMAC\-SHA\-256
  200. T} T{
  201. AES256\-CTR
  202. T} T{
  203. HMAC\-SHA256
  204. T} T{
  205. any
  206. T}
  207. _
  208. T{
  209. authenticated\-blake2
  210. T} T{
  211. BLAKE2b
  212. T} T{
  213. none
  214. T} T{
  215. BLAKE2b
  216. T} T{
  217. 1.1
  218. T}
  219. _
  220. T{
  221. authenticated
  222. T} T{
  223. HMAC\-SHA\-256
  224. T} T{
  225. none
  226. T} T{
  227. HMAC\-SHA256
  228. T} T{
  229. 1.1
  230. T}
  231. _
  232. T{
  233. none
  234. T} T{
  235. SHA\-256
  236. T} T{
  237. none
  238. T} T{
  239. none
  240. T} T{
  241. any
  242. T}
  243. _
  244. .TE
  245. .\" nanorst: inline-replace
  246. .
  247. .sp
  248. \fInone\fP mode uses no encryption and no authentication. You\(aqre advised to NOT use this mode
  249. as it would expose you to all sorts of issues (DoS, confidentiality, tampering, ...) in
  250. case of malicious activity in the repository.
  251. .sp
  252. If you do \fBnot\fP want to encrypt the contents of your backups, but still want to detect
  253. malicious tampering use an \fIauthenticated\fP mode. It\(aqs like \fIrepokey\fP minus encryption.
  254. .SS Key derivation functions
  255. .INDENT 0.0
  256. .IP \(bu 2
  257. \fB\-\-key\-algorithm argon2\fP is the default and is recommended.
  258. The key encryption key is derived from your passphrase via argon2\-id.
  259. Argon2 is considered more modern and secure than pbkdf2.
  260. .UNINDENT
  261. .sp
  262. Our implementation of argon2\-based key algorithm follows the cryptographic best practices:
  263. .INDENT 0.0
  264. .IP \(bu 2
  265. It derives two separate keys from your passphrase: one to encrypt your key and another one
  266. to sign it. \fB\-\-key\-algorithm pbkdf2\fP uses the same key for both.
  267. .IP \(bu 2
  268. It uses encrypt\-then\-mac instead of encrypt\-and\-mac used by \fB\-\-key\-algorithm pbkdf2\fP
  269. .UNINDENT
  270. .sp
  271. Neither is inherently linked to the key derivation function, but since we were going
  272. to break backwards compatibility anyway we took the opportunity to fix all 3 issues at once.
  273. .SH OPTIONS
  274. .sp
  275. See \fIborg\-common(1)\fP for common options of Borg commands.
  276. .SS optional arguments
  277. .INDENT 0.0
  278. .TP
  279. .BI \-\-other\-repo \ SRC_REPOSITORY
  280. reuse the key material from the other repository
  281. .TP
  282. .BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE
  283. select encryption key mode \fB(required)\fP
  284. .TP
  285. .B \-\-append\-only
  286. create an append\-only mode repository. Note that this only affects the low level structure of the repository, and running \fIdelete\fP or \fIprune\fP will still be allowed. See \fIappend_only_mode\fP in Additional Notes for more details.
  287. .TP
  288. .BI \-\-storage\-quota \ QUOTA
  289. Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
  290. .TP
  291. .B \-\-make\-parent\-dirs
  292. create the parent directories of the repository directory, if they are missing.
  293. .TP
  294. .B \-\-key\-algorithm
  295. the algorithm we use to derive a key encryption key from your passphrase. Default: argon2
  296. .UNINDENT
  297. .SH EXAMPLES
  298. .INDENT 0.0
  299. .INDENT 3.5
  300. .sp
  301. .nf
  302. .ft C
  303. # Local repository
  304. $ export BORG_REPO=/path/to/repo
  305. # recommended repokey AEAD crypto modes
  306. $ borg rcreate \-\-encryption=repokey\-aes\-ocb
  307. $ borg rcreate \-\-encryption=repokey\-chacha20\-poly1305
  308. $ borg rcreate \-\-encryption=repokey\-blake2\-aes\-ocb
  309. $ borg rcreate \-\-encryption=repokey\-blake2\-chacha20\-poly1305
  310. # no encryption, not recommended
  311. $ borg rcreate \-\-encryption=authenticated
  312. $ borg rcreate \-\-encryption=none
  313. # Remote repository (accesses a remote borg via ssh)
  314. $ export BORG_REPO=ssh://user@hostname/~/backup
  315. # repokey: stores the (encrypted) key into <REPO_DIR>/config
  316. $ borg rcreate \-\-encryption=repokey\-aes\-ocb
  317. # keyfile: stores the (encrypted) key into ~/.config/borg/keys/
  318. $ borg rcreate \-\-encryption=keyfile\-aes\-ocb
  319. .ft P
  320. .fi
  321. .UNINDENT
  322. .UNINDENT
  323. .SH SEE ALSO
  324. .sp
  325. \fIborg\-common(1)\fP, \fIborg\-rdelete(1)\fP, \fIborg\-rlist(1)\fP, \fIborg\-check(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP
  326. .SH AUTHOR
  327. The Borg Collective
  328. .\" Generated by docutils manpage writer.
  329. .