Re: Change password from shellscript
On Monday 15 Dec 2003 7:04 pm, Peter wrote:
> I want to make a shellscript with the ability to change a
> userspassword. I can't get it to work properly because when i say
> passwd user i will have to enter the password is there a way or a
> switch todo this in a style like passwd user password
My version of passwd has a --stdin switch which'll read the
password from STDIN, i.e.
echo $password | passwd --stdin $username
If your's doesn't you may want to take a look at expect.