[GH-ISSUE #483] SHA512 hash cannot be replicated for MacOS hosts #265

Closed
opened 2026-04-08 16:51:36 +03:00 by zhus · 1 comment
Owner

Originally created by @R-Bose on GitHub (Nov 16, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/483

Problem

The documentation references the following when generating hashes for users:
$ mkpasswd -m sha-512 123456 $6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/

However MacOS does not ship with mkpasswd, nor does homebrew have that package, so I sought out to generate the SHA512 using openssl with the command:
openssl passwd -6

Screenshots/Media

image

As you can see, the hashes do not match.

I tried another online hash generator and this is what shows up:
image

The hashes don't match again, and seems like all are different.

So perhaps, could you integrate the hash generating capability into dufs with an optional arg like:
dufs sha512
<enter password input without echoing>
Hashed password: $6$.......

Ideally, plaintext passwords should not be supported and instead enforce hashing and salting for stored passwords, so maybe that can be implemented too?

Environment Information

  • Dufs version: 0.43.0
  • Browser/Webdav info: Not applicable
  • OS info: MacOS 15.1 (24B83)
  • Proxy server (if any): Not applicable
Originally created by @R-Bose on GitHub (Nov 16, 2024). Original GitHub issue: https://github.com/sigoden/dufs/issues/483 **Problem** The documentation references the following when generating hashes for users: `$ mkpasswd -m sha-512 123456 $6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/` However MacOS does not ship with mkpasswd, nor does homebrew have that package, so I sought out to generate the SHA512 using openssl with the command: `openssl passwd -6 ` **Screenshots/Media** <img width="724" alt="image" src="https://github.com/user-attachments/assets/33124bb3-709b-4e4d-a065-0be001971f2b"> As you can see, the hashes do not match. I tried another online hash generator and this is what shows up: <img width="880" alt="image" src="https://github.com/user-attachments/assets/958ed91c-0e13-42a3-accc-07286801386f"> The hashes don't match again, and seems like all are different. So perhaps, could you integrate the hash generating capability into dufs with an optional arg like: `dufs sha512` `<enter password input without echoing>` `Hashed password: $6$.......` Ideally, plaintext passwords should not be supported and instead enforce hashing and salting for stored passwords, so maybe that can be implemented too? **Environment Information** - Dufs version: 0.43.0 - Browser/Webdav info: Not applicable - OS info: MacOS 15.1 (24B83) - Proxy server (if any): Not applicable
zhus closed this issue 2026-04-08 16:51:36 +03:00
Author
Owner

@sigoden commented on GitHub (Nov 16, 2024):

The openssl passwd -6 command should work. You should wrap the hashed password in single quotes.

- dufs -a admin:$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/@/:rw
+ dufs -a 'admin:$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/@/:rw'

I have improved the README about hashed password.

Ideally, plaintext passwords should not be supported and instead enforce hashing and salting for stored passwords

Hashed passwords balance usability and security, The probability of cracking through a rainbow table is nearly zero. Hashing and salting passwords complicate the issue without providing much additional security, it's not worth it.

<!-- gh-comment-id:2480492108 --> @sigoden commented on GitHub (Nov 16, 2024): The `openssl passwd -6` command should work. You should wrap the hashed password in single quotes. ```diff - dufs -a admin:$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/@/:rw + dufs -a 'admin:$6$tWMB51u6Kb2ui3wd$5gVHP92V9kZcMwQeKTjyTRgySsYJu471Jb1I6iHQ8iZ6s07GgCIO69KcPBRuwPE5tDq05xMAzye0NxVKuJdYs/@/:rw' ``` I have improved the README about hashed password. > Ideally, plaintext passwords should not be supported and instead enforce hashing and salting for stored passwords Hashed passwords balance usability and security, The probability of cracking through a rainbow table is nearly zero. Hashing and salting passwords complicate the issue without providing much additional security, it's not worth it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#265