1

I am hunting the web on how to change passwords of an existing user using a salted hash.

I found that way with adding a non-existing user:

https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script

But I want to change the password of an existing user.

The man page of passwd is laking documentation on how to do that.

user164328
  • 11
  • 1
  • Can't be done. And it Unix has used salted passwords for as long as I remember (almost 30 years now), so... What are you really trying to do? – vonbrand Mar 13 '13 at 11:08

1 Answers1

3

The crypt function in Linux has been using salted password hashes since before the 1.2 kernel series so this is likely a non-issue.

That said, the salt is a system-wide salt so you can't set one per-user. When you change a password it is run through crypt() again using the system-wide salt.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300