Piping password to smbpasswd

UnkwnTech picture UnkwnTech · Aug 15, 2008 · Viewed 28.5k times · Source

How can I pipe the new password to smbpasswd so I can automate my installation process.

Answer

UnkwnTech picture UnkwnTech · Aug 15, 2008

Thanks to Mark I found the answer:

(echo newpassword; echo confirmNewPassword) | smbpasswd -s

BTW: (echo oldpasswd; echo newpasswd) | smbpasswd -s does not work.