[BusyBox] how does passwd work

Rob Landley rob at landley.net
Sat Feb 26 16:52:04 UTC 2005


On Friday 25 February 2005 03:17 pm, Jim Bauer wrote:
> On Friday 25 February 2005 11:42, Ralph Siemsen wrote:
> > A relatively painless way to handle setting the password from a script
> > is to make use of the passwd command - it will know the correct format
> > on the system it runs on.  I have used the following approach:
> >
> > (echo NEWPASS; sleep 1; echo NEWPASS) | passwd USERNAME
> >
> > Some versions of "passwd" also accept the password as a parameter on the
> > commandline, or on stdin like so:
> >
> > echo PASSWORD | /usr/bin/passwd --stdin USERNAME
>
> If portability is a concern, be aware that some versions
> of passwd always open up /dev/tty for user interaction.

I've encountered these pathologically broken passwd commands myself.  (I 
believe you can use a pty to shut them up.)  But if he's using the busybox 
passwd command, it isn't pathologically broken the way the samba one is.

Rob



More information about the busybox mailing list