on Friday, May 10, 2013, Jeff Jibson wrote:
> -s used stdin for password prompt Now how the heck did I miss that? I went back and looked at the man page again (for the 4th time) and there it is. But I could swear the first three times it wasn't there. Boy do I feel silly now. Thanks guys! Appreciate the help! :) --- Dan -----Legal Aide, Access on 5/11/2013 2:36 AM wrote: > smbpasswd from stdin? Jeff Jibson [email protected] via plug.org 5:55 PM (17 hours ago) to Provo -s When run by root: smbpasswd [options] [username] otherwise: smbpasswd [options] options: -L local mode (must be first option) -h print this usage message -s use stdin for password prompt -c smb.conf file Use the given path to the smb.conf file -D LEVEL debug level -r MACHINE remote machine -U USER remote username extra options when run by root or in local mode: -a add user -d disable user -e enable user -i interdomain trust account -m machine trust account -n set no password -W use stdin ldap admin password -w PASSWORD ldap admin password -x delete user -R ORDER name resolve order On Fri, May 10, 2013 at 2:36 AM, Dan Egli <[email protected]> wrote: > *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. > */ > /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */ /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
