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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content