mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #483] SHA512 hash cannot be replicated for MacOS hosts #265
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 -6Screenshots/Media
As you can see, the hashes do not match.
I tried another online hash generator and this is what shows up:

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
@sigoden commented on GitHub (Nov 16, 2024):
The
openssl passwd -6command should work. You should wrap the hashed password in single quotes.I have improved the README about hashed password.
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.