Managing Samba Users smbasswd and pdbedit

The easiest way to manage Samba users is to use the system-config-samba tool. Click Preferences to select Samba Users. In this window you can then add, edit, or remove Samba users. In the SWAT tool you would use the Password panel.

To manage users you can either use the smbpasswd command or the pdbedit tool. The smbpasswd command with the -a option will add a user and the -x option will remove one.

smbpasswd -a aleina

To enable or disable users you would use the -e and -d options.

The smbpasswd command will operate on both the older smbasswd file or the newer tdbsam backend database files. For just the tdbsam backend database files you can use pdbedit instead. To add a user you would use the -a option and to remove a user you use the -x option.

pdbedit -a larisa

This is a command line tool with options for adding and removing users, as well as features like changing password and setting the home directory. You can also import or export the user entries to or from other backend databases.

The pdbedit command lets you display more information about users. To display users from the backend database you could use the -L option. Add the -v option for detailed information. For a particular user add the user name.

pdbedit -Lv richard

For domain policies like minimum password length or retries, you use the -P option.

pdbedit -P

You use the -i and -e options to import and export database entries. The following will import entries from the old smbpasswd file to the new tdbsam backend database.

pdbedit -i smbpasswd -e tdbsam

If your system is using LDAP-enabled Samba database, then use the smbldap tools to manage users and groups.

Continue reading here: Configuring Samba with systemconfigsamba

Was this article helpful?

+1 -1