3

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?

Lothar
  • 529
  • 1
  • 5
  • 19

1 Answers1

4
$ 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 )

Community
  • 1
  • 1
raph
  • 64
  • 3
  • In regards to the `-r` option of `pdbedit`: This flag is kept for backwards compatibility, but it is no longer necessary to specify it. – MrCalvin Feb 17 '20 at 14:45