0

I created a new user using useradd utility and then modified the user to add password to it. I am unable to understand what does "Alternate authentication scheme in use." mean. Also how to update the user so that it updates to Password set, SHA512 crypt. status.

Also while doing this I saw that password in /etc/shadow is not encrypted. Did I miss anything while adding password? Shouldn't this be implicit action by the system?

useradd user

passwd -S user

user LK 2016-12-24 0 99999 7 -1 (Password locked.)

usermod -p "Password"

user PS 2016-12-24 0 99999 7 -1 (Alternate authentication scheme in use.)

4

When you want to use usermod -p you have to pass an encrypted password to it. from man pages:

-p, --password PASSWORD

The encrypted password, as returned by crypt(3).

There is many way to get an encrypted password. for example using openssl:

openssl passwd -1 -salt xyz  yourpass

If you want to update user password to SHA512 just use passwd, but, first make sure that your system use SHA512 encrypt method

Two place you have to check:

/etc/login.defs

ENCRYPT_METHOD SHA512

/etc/pam.d/common-password

password [success=2 default=ignore] pam_unix.so obscure sha512
|improve this answer|||||
  • 1
    cool.. I figured the passwd and login.defs file but I did not know about the common-password file. – Shashank Vyas Dec 26 '16 at 4:13
0

Updating password using passwd seems to fix the entire situation. I am guessing usermod is not the correct way to add a password to a user we just created.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.