NOTE: Tricky question, for Advanced Linuxoids only !
hi,
how can I create encrypted passwords from shell script ?
in Debian "mkpasswd" does this job, but not so for Red Hat...
In Debian, when I write shell, I can change user's password, like this:
usermod -p $(mkpasswd -s $password) $user
I'm trying to find equivalent in Red Hat.
I did "man usermod" and "man adduser" but both require encrypted password.
Notice: "mkpasswd" command does *exist* in Red Hat (part of "expect"), but is completely different from Debian's... so I'm stuck.
Any ideas?
Thanks in advance,
-Technologov
How to change user's password from shell ?
Re: How to change user's password from shell ?
Does this work?
[code]
$ echo password | openssl passwd -crypt -stdin
wBTin4MUnz.Qk
[/code]
[code]
$ echo password | openssl passwd -crypt -stdin
wBTin4MUnz.Qk
[/code]
How to change user's password from shell ?
[quote]
Technologov wrote:
I did "man usermod" and "man adduser" but both require encrypted password.[/quote]
man passwd
Not sure if this is what you're looking for, but
[code]echo password | passwd --stdin[/code]would allow you to change passwords from a script.
Technologov wrote:
I did "man usermod" and "man adduser" but both require encrypted password.[/quote]
man passwd
Not sure if this is what you're looking for, but
[code]echo password | passwd --stdin[/code]would allow you to change passwords from a script.