Discussion:
[Samba] smbpasswd usage
(too old to reply)
Michel Bouchet
2005-12-24 06:50:09 UTC
Permalink
Hi,

I used to set up Samba password on the command line with smbpasswd using the
following syntax :
smbpasswd -a newuser "usersecretpasswd"
smbpasswd -e newuser
but it does work any more.

How can I do the same without having to type in the password ?

Thanks in advance.

Michel
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
Mark Nienberg
2005-12-25 05:40:16 UTC
Permalink
Post by Michel Bouchet
Hi,
I used to set up Samba password on the command line with smbpasswd using the
smbpasswd -a newuser "usersecretpasswd"
smbpasswd -e newuser
but it does work any more.
How can I do the same without having to type in the password ?
Thanks in advance.
Michel
I haven't tried it, but this messagage was in the archives from June 27,
2005:


I had a little bit of trouble on my Redhat 9 system trying to get
smbpasswd to accept passwords on stdin so I can script it.

All of the solutions I saw on the mailing list were of the general
form:

(echo <pass>; echo <pass>) | smbpasswd -s <username>

For whatever reason, that didn't work for me. (note: I'm not much of a
Bash programmer!) What did however, is:

echo -n -e "$PASS1\n$PASS2" | smbpasswd -as $USERNAME

The -n switch tells echo not to add a trailing newline character, and
the -e switch tells it to interpret C-style escape characters, of which
\n is the carriage-return escape code. This is also assuming $PASS1 is
identical to $PASS2.

Hope this helps someone!
-- Nick Soracco <***@hrd-aerosystems.com> HRD Aerosystems, Inc.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
Loading...