usermod vs passwd - usermod not working
I have a CentOS machine, and I made a test user then set his password to splinter:
Code:
# useradd test1 Code:
mycentos login: test1 Code:
... Code:
# passwd test1 Why is usermod failing to change the password but the passwd command works just fine? SK |
Have a look through the man page for "usermod" and you'll find something like this.
Code:
-p, --password PASSWORD |
it worked for me in,
Void Linux Code:
root@voided/home/userx >># useradd deleteme found this it is way worth the read "A Complete Guide to Usage of ‘usermod’ command – 15 Practical Examples with Screenshots" Code:
Create Un-encrypted Password for User |
Have a look at "/usr/sbin/chpasswd" which is a password changing program for batch (bulk) processing of users.
It can take the password in the clear, or a pre-encrypted passwd. For example Code:
useradd junkuser |
Interesting responses and information, thanks everyone, here are some thoughts.
@cnamejj I did see entry in the manpage about crypt, but I couldn't find any information on how to use it. For example, I couldn't find a yum package that had crypt in it, nor could I find a man page for crypt. @BW-userx Its interesting that your login didn't work, but sudo did. I didn't try sudo, just logging in myself. Either way, the user wouldn't be able to log in if I did a usermod -p, so that's the issue I'm trying to fix. Was a good read @A.Thyssen Well, it doesn't answer why usermod doesn't work, but that is a really interesting solution. SK |
All times are GMT -5. The time now is 12:26 AM. |