pdbedit

From RaySoft

The pdbedit program is used to manage the users accounts stored in the sam database and can only be run by root.[1]

The pdbedit tool uses the passdb modular interface and is independent from the kind of users database used.[1]

There are five main ways to use pdbedit: adding a user account, removing a user account, modifing a user account, listing user accounts, importing users accounts.[1]

Documentation

Syntax

pdbedit [PARAMETER ...]

Parameters

-a
This option is used to add a user into the database. This command needs a user name specified with the -u switch. When adding a new user, pdbedit will also ask for the password to be used.
-e BACKEND
Exports all currently available users to the specified password database BACKEND.
This option will ease migration from one passdb backend to another and will ease backing up.
-i BACKEND
Use a different passdb BACKEND to retrieve users than the one specified in 'smb.conf'. Can be used to import data into your local user database.
This option will ease migration from one passdb backend to another.
-L
This option lists all the user accounts present in the users database. This option prints a list of user/uid pairs separated by the : character.

Examples

Migration from 'smbpasswd' to LDAP
pdbedit -i 'smbpasswd:/etc/samba/smbpasswd' -e 'ldapsam:ldaps://ldap.raysoft.loc'

References

  1. 1.0 1.1 1.2 man 8 'pdbedit'