NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

douglaswyatt's avatar
douglaswyatt
Aspirant
Sep 03, 2014

Manually setting password hashes

Not sure if this is the right place to post this, but I've got a possibly strange question. I'd like to be able to manually set the password hash for users, and I'm not sure if the ReadyNAS OS 6 supports sha512 hashes, or if I'm doing something else wrong. I want to do this because I'd like a user's password to be the same on the ReadyNAS as it is on another Linux box, without having them have to set their passwords twice. I ssh'd in to the box, made /etc/shadow writable, and edited a user's entry to include a password hash created on a different machine (CentOS). It didn't work - I see "FAILED with error NT_STATUS_WRONG_PASSWORD" in the log files. But I noticed that the passwords in /etc/shadow start with a $1 prefix, indicating that they are MD5 hash, while the password I pasted starts with a $6, indicating it's a SHA512 hash. Looking in the /etc/pam.d/common-password file, it appears that SHA512 is the hash of choice for the ReadyNAS:

# Explanation of pam_unix options:
#
# The "sha512" option enables salted SHA512 passwords. Without this option,
# the default is Unix crypt. Prior releases used the option "md5".
[...]
#password [success=1 default=ignore] pam_unix.so obscure sha512
password [success=1 default=ignore] pam_unix.so sha512


So I've got two questions:
First, why does it appear that the ReadyNAS is creating MD5 hashes instead of SHA512?

Second, why doesn't it seem to like my cut-and-pasted SHA512 password hashes created on another Linux box?

Thanks!

3 Replies

Replies have been turned off for this discussion
  • mdgm-ntgr's avatar
    mdgm-ntgr
    NETGEAR Employee Retired
    You would need to use smbpasswd to change the password for samba I think.

    I'm not sure if these changes would survive a reboot. You may also need to edit the readynasd database.
  • Ah, yes. should have thought of that. I'm used to samba installations that share passwords out of /etc/passwd|shadow. Is there a way to edit the readynasd database? Or am I asking to do something that is fighting too much of the readynas structure?
  • mdgm-ntgr's avatar
    mdgm-ntgr
    NETGEAR Employee Retired
    That is maintained using the sqlite3 command.

    You can check if the information is in the database or not by downloading the logs and looking in db.dump

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More