LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Change password of new user (https://www.linuxquestions.org/questions/programming-9/change-password-of-new-user-4175424909/)

Aerosilver 08-31-2012 02:08 AM

Change password of new user
 
Hi,

I have a doubt with a new user. I want to change his password with the command "usermod -p $newpass $user".
The password is changed, but when I try to login with that user, the system say "Wrong password" or something like that.

Is that the correct way to change a password? I don't wanna use the passwd $user. Is very unpersonalized..

Thanks.

NevemTeve 08-31-2012 02:15 AM

try 'passwd <username>' or something like that.

Aerosilver 08-31-2012 02:16 AM

Quote:

Originally Posted by NevemTeve (Post 4768894)
try 'passwd <username>' or something like that.

I don't want to use the passwd because is in english and is unpersonalized. I want to create my own prompted "passwd" with the usermod, but this is not working.

NevemTeve 08-31-2012 02:21 AM

The root-user of a computer is supposed to understand English... but if they don't, just set LANG environment:

Code:

LANG=hu_HU passwd
zsiga jelszavának megváltoztatása.
A (jelenlegi) UNIX jelszó:
...

PS: If you read the manual, it tells you that usermod -p expects encrypted password, not plain-text.

Aerosilver 08-31-2012 02:33 AM

Quote:

Originally Posted by NevemTeve (Post 4768897)
The root-user of a computer is supposed to understand English... but if they don't, just set LANG environment:

Code:

LANG=hu_HU passwd
zsiga jelszavának megváltoztatása.
A (jelenlegi) UNIX jelszó:
...

PS: If you read the manual, it tells you that usermod -p expects encrypted password, not plain-text.

Ok. I modified the LANG and it's in spanish, but anyway I wanted to personalize my "password changer".
Do you know how to send a encrypted password?
Something like this?:

Code:

usermod -p ENCRYPT($pass) $user


All times are GMT -5. The time now is 09:21 AM.