automationinstallationdebiansamba

Piping password to smbpasswd


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


Solution

  • Thanks to Mark I found the answer:

    (echo newpassword; echo confirmNewPassword) | smbpasswd -s
    

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