Using smbpasswd from a pipe

Jacques Gelinas jack at
Thu Oct 16 12:50:24 GMT 1997

As part of the linuxconf project (see my signature), an administration
module for Samba has been done. It manage most options of smb.conf.
Another thing it does is transparent management of both /etc/passwd and
/etc/smbpasswd. You flip a check box and both file are maintained
from the various user interface supplied by linuxconf (ncurses, html, the
passwd command).

To achieve this, we call the smbpasswd command and send the password on
stdin. This did not work at first because smbpasswd read from /dev/tty
directly (using the getpass). So I have modified this utility to simply
read from stdin when handle 0 is not a tty (no added option).

Is there another way to achieve that. Are there other people who have
created some procedure to maintain both passwords automagically.

To get the diff, please email.

Jacques Gelinas (jacques at
Linuxconf: The ultimate administration system for Linux.
new developments: mail to fax gateway, Apache, Samba

More information about the samba mailing list