]> OzVa Git service - ozva-cloud/commitdiff
chore: update readme about hashed password
authorsigoden <sigoden@gmail.com>
Sat, 16 Nov 2024 09:08:37 +0000 (17:08 +0800)
committersigoden <sigoden@gmail.com>
Sat, 16 Nov 2024 09:11:42 +0000 (17:11 +0800)
README.md

index dad7dfd4d36f8f1c9fb6dfe5487a57d501a86e02..fb8e951bd0515ca5a313a8055e8898a5f81fefcf 100644 (file)
--- a/README.md
+++ b/README.md
@@ -252,16 +252,20 @@ DUFS supports the use of sha-512 hashed password.
 
 Create hashed password
 
-```
-$ mkpasswd -m sha-512 123456
+```sh
+$ openssl passwd -6 123456 # or `mkpasswd -m sha-512 123456`
 $6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/
 ```
 
 Use hashed password
-```
+```sh
+dufs -a "admin:$(openssl passwd -6 123456)@/:rw"
+dufs -a "admin:$(mkpasswd -m sha-512 123456)@/:rw"
 dufs -a 'admin:$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/@/:rw'
 ```
 
+> The hashed password contains `$6`, which can expand to a variable in some shells, so you have to use **single quotes** to wrap it.
+
 Two important things for hashed passwords:
 
 1. Dufs only supports sha-512 hashed passwords, so ensure that the password string always starts with `$6$`.