Change user password in samba server with the pdbedit tool
15,991
$ printf "%s\n%s\n" pwd pwd|pdbedit -t -r -u user
does not appear to work either
According to http://git.samba.org/?p=samba.git;a=blob;f=source3/utils/pdbedit.c
the --password-from-stdin
parameter (pw_from_stdin
) only affects account creation.
Thus, you'll rather prefer smbpasswd
$ printf "%s\n%s\n" pwd pwd|smbpasswd -s user
( Piping password to smbpasswd )
Comments
-
Lothar almost 2 years
I am trying to change user password with script but I'm having trouble using the -t option. Here's what I try:
echo -e "12345\n12345\n" | pdbedit -t -u username
So this is wrong somehow. Any ideas what I am missing or what should I try?
-
MrCalvin about 4 yearsIn regards to the
-r
option ofpdbedit
: This flag is kept for backwards compatibility, but it is no longer necessary to specify it.