scripted (bash) password changes for Samba users...

© 2022 www.JaxBeachTech.com  |  Ph: 9o4.834.o433  |   email  |  [50.41]

Submitted by donmc on Fri, 06/27/2014 - 19:49

I was excited to find this, so I am saving it here.

To change an smb passwd in a bash script:

echo -e "newpasswd\nnewpasswd" | (smbpasswd -s username)

And note the "\n" in there to push a newline between the two passwords...

For the unix (Linux) username:

echo -e "newpass\nnewpass" | (passwd --stdin username)