  | |  | Passwd --stdin pipe | Passwd --stdin pipe 2004-03-24 - By Ed Wilts
Back On Wed, Mar 24, 2004 at 12:10:57PM -0500, Jeff Graves wrote:
> I 'm trying to use the passwd --stdin option to pipe a plain text
> password through passwd so it gets encrypted and set properly (since
> this is my first attempt at writing shell scripts and whatnot). Just for
> testing, I 'm running this code at the command line. This is the syntax
> I 'm using:
>
> echo password | passwd --stdin username
>
> It 's says all tokens updated successfully but when I try to log in using
> the new password, I get a login incorrect. If I type:
This is what I 'm using (RHL 6.2):
NEWPASSWORD=$(password-generator)
echo "Attempting to set password to $NEWPASSWORD "
echo $NEWPASSWORD | passwd --stdin $USER
(echo $NEWPASSWORD ; echo $NEWPASSWORD) | smbpasswd -a -s $USER
This has been working fine for me for several years.
--
Ed Wilts, Mounds View, MN, USA
mailto:ewilts@(protected)
Member #1, Red Hat Community Ambassador Program
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
|
|
 |