]> Cypherpunks.ru repositories - gocheese.git/blob - doc/passwords.texi
d3d9ad4039b09092c0e5969020a8f230359e3850
[gocheese.git] / doc / passwords.texi
1 @node Passwords
2 @unnumbered Password authentication
3
4 Password authentication is required for packages uploading. Passwords
5 are dynamically changed through the FIFO file. You have to create it and
6 use in @option{-passwd} option:
7
8 @example
9 $ mkfifo passwd
10 $ gocheese -passwd passwd ...
11 @end example
12
13 Then you must feed it newline-separated records in following format:
14
15 @example
16 username:hashed-password
17 @end example
18
19 Where @code{hashed-password} is in one of following algorithms:
20
21 @table @asis
22
23 @item @url{https://www.argon2i.com/, Argon2i} (recommended one!)
24     To get Argon2i hashed-password you can use any of following tools:
25
26     @itemize
27     @item @code{go get @url{https://github.com/balakhonova/argon2i,
28         github.com/balakhonova/argon2i}} (Go)
29     @item @url{https://github.com/p-h-c/phc-winner-argon2} (C)
30     @end itemize
31
32     Example user @code{foo} with password @code{bar} can have the
33     following password file entry:
34
35 @verbatim
36 foo:$argon2i$v=19$m=32768,t=3,p=4$OGU5MTM3YjVlYzQwZjhkZA$rVn53v6Ckpf7WH0676ZQLr9Hbm6VH3YnL6I9ONJcIIU
37 @end verbatim
38
39 @item SHA256
40     You can use your operating system tools:
41
42 @example
43 $ echo -n "password" | `command -v sha256 || echo sha256sum`
44 @end example
45
46     Example user @code{foo} with password @code{bar} will have the
47     following password file entry:
48
49 @verbatim
50 foo:$sha256$fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
51 @end verbatim
52
53 @end table
54
55 To add or update password entry:
56
57 @example
58 $ echo foo:$sha256$... > passwd
59 $ cat passwords.txt > passwd
60 @end example
61
62 To delete login entry use empty password:
63
64 @example
65 $ echo foo: > passwd
66 @end example
67
68 You can also check you passwords file with:
69
70 @example
71 $ gocheese -passwd-check < passwords.txt
72 $ echo $?
73 @end example