Linux command
pdbedit 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
List
sudo pdbedit --list --verbose
Add
sudo pdbedit --user [username] --create
Remove
sudo pdbedit --user [username] --delete
Reset
sudo pdbedit --user [username] --bad-password-count-reset
说明
pdbedit manages the Samba user database (SAM database), allowing administrators to add, modify, and delete Samba user accounts. It provides more detailed control than smbpasswd, including access to user flags, password policies, and database import/export. Users must exist in the Unix system before being added to Samba. The tool can operate on different passdb backends including tdbsam (default) and ldapsam for LDAP integration.
参数
- -L, --list
- List all Samba user accounts
- -v, --verbose
- Enable verbose listing mode
- -u, --user _username_
- Specify the user to operate on
- -a, --create
- Add a new user account (prompts for password)
- -x, --delete
- Delete specified user account
- -z, --bad-password-count-reset
- Reset bad password count for user
- -t, --password-from-stdin
- Read password from stdin
- -w, --smbpasswd-style
- Use smbpasswd-style output
- -e, --export
- Export user database to stdout
- -i, --import
- Import user database from stdin
- -b, --backend _name_
- Use specified passdb backend
- -P, --account-policy
- Display or change account policy
- --policies-reset
- Reset account policies to default
FAQ
What is the pdbedit command used for?
pdbedit manages the Samba user database (SAM database), allowing administrators to add, modify, and delete Samba user accounts. It provides more detailed control than smbpasswd, including access to user flags, password policies, and database import/export. Users must exist in the Unix system before being added to Samba. The tool can operate on different passdb backends including tdbsam (default) and ldapsam for LDAP integration.
How do I run a basic pdbedit example?
Run `sudo pdbedit --list --verbose` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -L, --list do in pdbedit?
List all Samba user accounts