LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change password of a user using usermod command (https://www.linuxquestions.org/questions/linux-newbie-8/change-password-of-a-user-using-usermod-command-820897/)

rahulchandrak 07-20-2010 12:28 AM

change password of a user using usermod command
 
Hi I am trying to change the password of a user by 'usermod' command. let us assume that there is a user named "test" to change the password of the user we can type "passwd test" which will change the password of the user "test". I want to change the password similarly using the command "usermod". when I give usermod -p yahoo test"(yahoo is the password which I want to set), I am not getting any errors but when I switch user to test, I am unable to login.

Wim Sturkenboom 07-20-2010 12:35 AM

from man usermod
Code:

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

So yahoo in your example is the encrypted password, not the clear password. Up to you to reverse engineer it ;) If you check /etc/shadow, you should see yahoo in there if I'm right.


All times are GMT -5. The time now is 08:13 AM.