How to change password via smbpasswd command and provide password from standard input

Solution Verified - Updated -

Issue

  • Is there any way to avoid password prompt while changing password via smbpasswd and provide password from standard input ?

  • Unable to create the smbpassword with -s option with smbpasswd, tried the following command at command prompt:

# echo password@1234 | smbpasswd testuser1 -s
# echo password@1234 | smbpasswd -a testuser1 -s

Mismatch - password unchanged. 
Unable to get new password.
  • Unable to create the smbpasswd with -s option.

Environment

  • Red Hat Enterprise Linux (All)
  • samba (smbpasswd)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.