Changing root password?

Bill Bogstad bogstad-e+AXbWqSrlAAvxtiuMwx3w at public.gmane.org
Sun Jul 26 16:42:41 EDT 2009


On Sat, Jul 25, 2009 at 6:46 PM, Scott Ehrlich<srehrlich-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> I've googled and cannot find a good answer (it's probably out there,
> just haven't found it yet...)
>
> In the Windows world, at least as admin, you can invoke a command
> prompt, type: net user account_of_choice password_of_choice, and the
> password of account_of_choice is changed to password_of_choice, clear
> text, yes, but Windows doesn't force a verification of the password.
>
> What is the equivalent method for an up-to-date Linux distro Centos?  Ubuntu?

This is a classic case of too much user interaction.  The UNIX
solution to this is the expect command.  It lets you automated any
command  line/terminal interaction.  Definitive information can be
found here:  http://expect.nist.gov

Here are some random google links for some expect scripts someone
wrote for changing passwords on multiple machines:

http://expect.nist.gov/doc/passmass.html
http://www.tek-tips.com/viewthread.cfm?qid=208592&page=228

Yes, this doesn't actually answer your question.  It's more like
teaching you to fish rather then giving you a fish...

Happy hacking,
Bill Bogstad






More information about the Discuss mailing list