Part of samba.netcmd.user View In Hierarchy
This command sets or resets the logon password for a user account. The username specified on the command is the sAMAccountName. The username may also be specified using the --filter option.
If the password is not specified on the command through the --newpassword parameter, the user is prompted for the password to be entered through the command line.
It is good security practice for the administrator to use the --must-change-at-next-login option which requires that when the user logs on to the account for the first time following the password change, he/she must change the password.
The command may be run from the root userid or another authorized userid. The -H or --URL= option can be used to execute the command against a remote server.
Example1: samba-tool user setpassword TestUser1 passw0rd --URL=ldap://samba.samdom.example.com -Uadministrator%passw1rd
Example1 shows how to set the password of user TestUser1 on a remote LDAP server. The --URL parameter is used to specify the remote target server. The -U option is used to pass the username and password of a user that exists on the remote server and is authorized to update the server.
Example2: sudo samba-tool user setpassword TestUser2 passw0rd --must-change-at-next-login
Example2 shows how an administrator would reset the TestUser2 user's password to passw0rd. The user is running under the root userid using the sudo command. In this example the user TestUser2 must change their password the next time they logon to the account.
Example3: samba-tool user setpassword --filter=samaccountname=TestUser3 --password=passw0rd
Example3 shows how an administrator would reset TestUser3 user's password to passw0rd using the --filter= option to specify the username.
Method | run | Run the command. This should be overriden by all subclasses. |
Inherited from Command:
Method | __init__ | Undocumented |
Method | usage | Undocumented |
Method | show_command_error | display a command error |
Method | message | Undocumented |
Method | get_logger | Get a logger object. |
Method | _get_short_description | Undocumented |
Method | _get_full_description | Undocumented |
Method | _get_name | Undocumented |
Method | _create_parser | Undocumented |
Method | _run | Undocumented |