[BusyBox] how does passwd work
Jim Bauer
jfbauer at nfr.com
Fri Feb 25 20:17:59 UTC 2005
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.
More information about the busybox
mailing list