*Hey pluggers,*

* *

*Does anyone know of a way to get smbpasswd to take the actual password of
the user from stdin on the command line? I mean, for example, the unix
passwd program has the --stdin parameter, which lets you echo the password
and pipe it, i.e*

* *

*echo ThisIsMyPass | passwd dan --stdin*

* *

*I know THAT would work, but I want to do something similar to smbpasswd.
What I'm trying to accomplish is basically:*

*echo -e "MyCIFSPasswd\nMyCIFSPasswd" | smbpasswd -a dan*

*I really don't care WHICH method is used, piping or redirecting, but
unless someone knows how samba encodes the fields in the
/etc/samba/smbpasswd file so that the file could be modified directly (not
a great idea, but the only other one that comes to my mind) this is the
only way I can see to accomplish the AUTOMATED adding of a user. Basically
this is for a web script (php) that will ask for a username, a home
directory, and a password on the web page, and when will add the user to
the system with shell /sbin/nologin and add them to the samba password
file, all using the password given on the web page (it does have 2 fields
for password, to ensure the password was typed the same twice).*

* *

*Your help on this is greatly appreciated!*

* *

*--- Dan*

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to