PDBEDIT(8)
π PDBEDIT π
okay so <rainbow>pdbedit</rainbow> is a System Administration tool (section 8 of the manual, bestie) and it manages the SAM database β that's the Database of Samba Users, iykyk. π
β¨ NAME β¨
pdbedit β manage the SAM database (Database of Samba Users) π«Ά
πΈ SYNOPSIS πΈ
pdbedit [-L|--list] [-v|--verbose] [-w|--smbpasswd-style]
[-u|--user=USER] [-N|--account-desc=STRING] [-f|--fullname=STRING]
[-h|--homedir=STRING] [-D|--drive=STRING] [-S|--script=STRING]
[-p|--profile=STRING] [-I|--domain=STRING] [-U|--user SID=STRING]
[-M|--machine SID=STRING] [-a|--create] [-r|--modify] [-m|--machine]
[-x|--delete] [-b|--backend=STRING] [-i|--import=STRING]
[-e|--export=STRING] [-g|--group] [-y|--policies] [--policies-reset]
[-P|--account-policy=STRING] [-C|--value=LONG]
[-c|--account-control=STRING] [--force-initialized-passwords]
[-z|--bad-password-count-reset] [-Z|--logon-hours-reset]
[--time-format=STRING] [-t|--password-from-stdin]
[-K|--kickoff-time=STRING] [--set-nt-hash=STRING] [-?|--help] [--usage]
[-d|--debuglevel=DEBUGLEVEL] [--debug-stdout] [--configfile=CONFIGFILE]
[--option=name=value] [-l|--log-basename=LOGFILEBASE] [--leak-report]
[--leak-report-full]
π¦ DESCRIPTION π¦
so this tool is part of the samba(7) suite. cute little family π
the pdbedit program manages the users accounts stored in the sam database, and ngl β it can only be run by root. like, root only, fr fr. no sneaking in. π€
the pdbedit tool uses the passdb modular interface, which means it does not care what kind of users database you're using β currently there's smbpasswd, ldap, nis+ and tdb based ones, and more can be added without changing the tool. iconic design honestly, the way that modularity ate. π
there are five main ways to use pdbedit:
- adding a user account
- removing a user account
- modifying a user account
- listing user accounts
- importing users accounts
β¨ OPTIONS β¨
-L,--listβ this lists every single user account chillin' in the users database. it prints a list ofuser/uidpairs separated by the':'character. π
Example: pdbedit -L
sorce:500:Simo Sorce
samba:45:Test User
-v,--verboseβ turns on the verbose listing format, sopdbeditlists the users in the database and prints out the account fields in a descriptive format. and if you use it together with-w, it also shows passwords hashes. π
Example: pdbedit -L -v
---------------
username: sorce
user ID/Group: 500/500
user RID/GRID: 2000/2001
Full Name: Simo Sorce
Home Directory: \\BERSERKER\sorce
HomeDir Drive: H:
Logon Script: \\BERSERKER\netlogon\sorce.bat
Profile Path: \\BERSERKER\profile
---------------
username: samba
user ID/Group: 45/45
user RID/GRID: 1090/1091
Full Name: Test User
Home Directory: \\BERSERKER\samba
HomeDir Drive:
Logon Script:
Profile Path: \\BERSERKER\profile
-w,--smbpasswd-styleβ sets the"smbpasswd"listing format. it makespdbeditlist the users in the database and print out the account fields in a format compatible with the smbpasswd file format (go checksmbpasswd(5)for the deets). but if you use it together with (-v) instead, it displays the passwords hashes in verbose output. π€«
Example: pdbedit -L -w
sorce:500:508818B733CE64BEAAD3B435B51404EE:
D2A2418EFC466A8A0F6B1DBB5C3DB80C:
[UX ]:LCT-00000000:
samba:45:0F2B255F7B67A7A9AAD3B435B51404EE:
BC281CE3F53B6A5146629CD4751D3490:
[UX ]:LCT-3BFA1E8D:
-u,--userusername β specifies the username to be used for whatever operation you asked for (listing, adding, removing). it's required in add, remove and modify operations, and optional in list operations. so basically the main character of half these commands. π-f,--fullnamefullname β can be used while adding or modifying a user account. it specifies the user's full name.
Example: -f "Simo Sorce"
-h,--homedirhomedir β can be used while adding or modifying a user account. it specifies the user's home directory network path.
Example: -h "\\\\BERSERKER\\sorce"
-D,--drivedrive β can be used while adding or modifying a user account. it specifies the windows drive letter to be used to map the home directory.
Example: -D "H:"
-S,--scriptscript β can be used while adding or modifying a user account. it specifies the user's logon script path.
Example: -S "\\\\BERSERKER\\netlogon\\sorce.bat"
--set-nt-hashβ can be used while modifying a user account. it sets the user's password using the nt-hash value given as a hexadecimal string. super useful to synchronize passwords. π
Example: --set-nt-hash 8846F7EAEE8FB117AD06BDD830B7586C
-p,--profileprofile β can be used while adding or modifying a user account. it specifies the user's profile directory.
Example: -p "\\\\BERSERKER\\netlogon"
-M,'--machine SID'SID|rid β can be used while adding or modifying a machine account. it specifies the machines' new primary group SID (Security Identifier) or rid.
Example: -M S-1-5-21-2447931902-1787058256-3961074038-1201
-U,'--user SID'SID|rid β can be used while adding or modifying a user account. it specifies the users' new SID (Security Identifier) or rid.
Example: -U S-1-5-21-2447931902-1787058256-3961074038-5004
Example: '--user SID' S-1-5-21-2447931902-1787058256-3961074038-5004
Example: -U 5004
Example: '--user SID' 5004
-c,--account-controlaccount-control β can be used while adding or modifying a user account. it specifies the users' account control property. the possible flags are, and I quote, listed below πN: No password requiredD: Account disabledH: Home directory requiredT: Temporary duplicate of other accountU: Regular user accountM: MNS logon user accountW: Workstation Trust AccountS: Server Trust AccountL: Automatic LockingX: Password does not expireI: Domain Trust Account
Example: -c "[X ]"
-K,--kickoff-timeβ used to modify the kickoff time for a certain user. use"never"as the argument to set the kickoff time to unlimited. βΎοΈ
Example: pdbedit -K never user
-a,--createβ used to add a user into the database. this command needs a user name specified with the-uswitch. when adding a new user,pdbeditwill also ask for the password to be used. π
Example: pdbedit -a -u sorce
new password:
retype new password
Note πpdbeditdoes not call the unix password synchronization script if unix password sync has been set. it only updates the data in the Samba user database. if you wish to add a user and synchronise the password immediately, use smbpasswd's-aoption.
-t,--password-from-stdinβ makespdbeditread the password from standard input instead of from/dev/tty(like thepasswd(1)program does). the password has to be submitted twice and terminated by a newline each. π₯-r,--modifyβ used to modify an existing user in the database. this command needs a user name specified with the-uswitch. other options can be specified to modify the properties of the specified user. this flag is kept for backwards compatibility, but ngl it is no longer necessary to specify it. π-m,--machineβ may only be used in conjunction with the-aoption. it makespdbeditadd a machine trust account instead of a user account (-u usernamewill provide the machine name).
Example: pdbedit -a -m -u w2k-wks
-x,--deleteβ causespdbeditto delete an account from the database. it needs a username specified with the-uswitch. bye bestie π
Example: pdbedit -x -u bob
-i,--importpassdb-backend β use a different passdb backend to retrieve users than the one specified insmb.conf. can be used to import data into your local user database.
this option will ease migration from one passdb backend to another. π§³
Example: pdbedit -i smbpasswd:/etc/smbpasswd.old
-e,--exportpassdb-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. πΎ
Example: pdbedit -e smbpasswd:/root/samba-users.backup
-g,--groupβ if you specify-g, then-i in-backend -e out-backendapplies to the group mapping instead of the user database.
this option will ease migration from one passdb backend to another and will ease backing up.
-b,--backendpassdb-backend β use a different default passdb backend.
Example: pdbedit -b xml:/root/pdb-backup.xml -l
-P,--account-policyaccount-policy β display an account policy. π
valid policies are: minimum password age, reset count minutes, disconnect time, user must logon to change password, password history, lockout duration, min password length, maximum password age and bad lockout attempt.
Example: pdbedit -P "bad lockout attempt"
account policy value for bad lockout attempt is 0
-C,--valueaccount-policy-value β sets an account policy to a specified value. this option may only be used in conjunction with the-Poption. (they're a package deal, besties π«Ά)
Example: pdbedit -P "bad lockout attempt" -C 3
account policy value for bad lockout attempt was 0
account policy value for bad lockout attempt is now 3
-y,--policiesβ if you specify-y, then-i in-backend -e out-backendapplies to the account policies instead of the user database.
this option will allow one to migrate account policies from their default tdb-store into a passdb backend, e.g. an LDAP directory server. β¨
Example: pdbedit -y -i tdbsam: -e ldapsam:ldap://my.ldap.host
--force-initialized-passwordsβ forces all users to change their password upon next login. everybody. all of them. no exceptions. π-N,--account-descdescription β can be used while adding or modifying a user account. it specifies the user's description field.
Example: -N "test description"
-Z,--logon-hours-resetβ can be used while adding or modifying a user account. it resets the user's allowed logon hours, so a user may login at any time afterwards. π free at last
Example, bestie: -Z. That's the whole vibe π
-z,--bad-password-count-resetβ use this when you're adding or modifying a user account and you wanna wipe out that stored bad login counter for the user you picked. fresh start energy β¨ Example:-z--policies-resetβ resets the general password policies saved for a domain right back to their default values. factory reset but make it domain-wide π Example:--policies-reset-I,--domainβ works while adding or modifying a user account, and it sets the user's domain field for you. Example:-I "MYDOMAIN"--time-formatβ okay so this one is literally not being used right now, it's just sitting there π-?,--helpβ prints a lil summary of all the command line options. your safety net fr fr π«Ά--usageβ shows a brief usage message. short, sweet, iconic.-d,--debuglevel=levelβ level is an integer from 0 to 10. if you don't specify it, the default is 1 for client applications.
the higher this value, the more detail gets logged to the log files about what the server is doing. at level 0, only critical errors and serious warnings show up. level 1 is the reasonable day-to-day setting β it generates a small amount of info about the operations carried out. π
levels above 1 generate a considerable amount of log data, so only use them when you're investigating a problem. levels above 3 are designed for developers only and generate HUGE amounts of log data, most of which is extremely cryptic π
heads up: specifying this parameter right here overrides the log level parameter in the /etc/samba/smb.conf file. no cap.
--debug-stdoutβ redirects debug output to STDOUT. by default all clients are logging to STDERR, so this is the glow-up if you want it in the other place β¨--configfile=<configuration file>β the file you name here contains the configuration details the client needs. the info in this file can be general for both client and server, or it can only give you client-specific stuff like options such asclient smb encrypt. check/etc/samba/smb.conffor more info. the default configuration file name is determined at compile time π¦--option=<name>=<value>β sets thesmb.conf(5)option "<name>" to value "<value>" straight from the command line. this overrides compiled-in defaults and any options read from the configuration file. if a name or a value includes a space, wrap the whole--option=name=valueinto quotes π-l,--log-basename=logdirectoryβ base directory name for log/debug files. the extension.prognamegets appended to it (likelog.smbclient,log.smbd, etc...). and note: the log file is never removed by the client πΈ--leak-reportβ turns on talloc leak reporting on exit. tidy queen behavior.--leak-report-fullβ turns on full talloc leak reporting on exit. the deluxe version, obsessed.-V,--versionβ prints the program version number. say hi to the version π
π NOTES
This command may be used only by root. like, literally only root, don't try it as your regular lil user account, it's giving permission denied π
π·οΈ VERSION
This man page is part of version 4.24.7-Ubuntu-4.24.7+dfsg-1ubuntu1 of the Samba suite. periodt.
π SEE ALSO
go read those too bestie, iykyk π«Ά
βοΈ AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. legends, honestly π
The pdbedit manpage was written by Simo Sorce and Jelmer Vernooij. thank you for your service π«‘
aaaand that's the whole page!! this was Samba 4.24.7-Ubuntu-4.24.7+dfsg-1ubuntu1, dated 09/13/2026, from the PDBEDIT(8) manual π
β¨ go forth and manage those databases, main character ππ
π¦ where this page comes from
- ubuntu stonking: samba 2:4.24.7+dfsg-1ubuntu1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms