source: vendor/current/docs/manpages/pdbedit.8

Last change on this file was 989, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.7

File size: 13.5 KB
Line 
1'\" t
2.\" Title: pdbedit
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5.\" Date: 10/25/2016
6.\" Manual: System Administration tools
7.\" Source: Samba 4.4
8.\" Language: English
9.\"
10.TH "PDBEDIT" "8" "10/25/2016" "Samba 4\&.4" "System Administration tools"
11.\" -----------------------------------------------------------------
12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------
14.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15.\" http://bugs.debian.org/507673
16.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18.ie \n(.g .ds Aq \(aq
19.el .ds Aq '
20.\" -----------------------------------------------------------------
21.\" * set default formatting
22.\" -----------------------------------------------------------------
23.\" disable hyphenation
24.nh
25.\" disable justification (adjust text to left margin only)
26.ad l
27.\" -----------------------------------------------------------------
28.\" * MAIN CONTENT STARTS HERE *
29.\" -----------------------------------------------------------------
30.SH "NAME"
31pdbedit \- manage the SAM database (Database of Samba Users)
32.SH "SYNOPSIS"
33.HP \w'\ 'u
34pdbedit [\-a] [\-b\ passdb\-backend] [\-c\ account\-control] [\-C\ value] [\-d\ debuglevel] [\-D\ drive] [\-e\ passdb\-backend] [\-f\ fullname] [\-\-force\-initialized\-passwords] [\-g] [\-h\ homedir] [\-i\ passdb\-backend] [\-I\ domain] [\-K] [\-L] [\-m] [\-M\ SID|RID] [\-N\ description] [\-P\ account\-policy] [\-p\ profile] [\-\-policies\-reset] [\-r] [\-s\ configfile] [\-S\ script] [\-\-set\-nt\-hash] [\-t] [\-\-time\-format] [\-u\ username] [\-U\ SID|RID] [\-v] [\-V] [\-w] [\-x] [\-y] [\-z] [\-Z]
35.SH "DESCRIPTION"
36.PP
37This tool is part of the
38\fBsamba\fR(7)
39suite\&.
40.PP
41The pdbedit program is used to manage the users accounts stored in the sam database and can only be run by root\&.
42.PP
43The pdbedit tool uses the passdb modular interface and is independent from the kind of users database used (currently there are smbpasswd, ldap, nis+ and tdb based and more can be added without changing the tool)\&.
44.PP
45There 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\&.
46.SH "OPTIONS"
47.PP
48\-L|\-\-list
49.RS 4
50This option lists all the user accounts present in the users database\&. This option prints a list of user/uid pairs separated by the \*(Aq:\*(Aq character\&.
51.sp
52Example:
53pdbedit \-L
54.sp
55.if n \{\
56.RS 4
57.\}
58.nf
59sorce:500:Simo Sorce
60samba:45:Test User
61.fi
62.if n \{\
63.RE
64.\}
65.RE
66.PP
67\-v|\-\-verbose
68.RS 4
69This option enables the verbose listing format\&. It causes pdbedit to list the users in the database, printing out the account fields in a descriptive format\&. Used together with \-w also shows passwords hashes\&.
70.sp
71Example:
72pdbedit \-L \-v
73.sp
74.if n \{\
75.RS 4
76.\}
77.nf
78\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
79username: sorce
80user ID/Group: 500/500
81user RID/GRID: 2000/2001
82Full Name: Simo Sorce
83Home Directory: \e\eBERSERKER\esorce
84HomeDir Drive: H:
85Logon Script: \e\eBERSERKER\enetlogon\esorce\&.bat
86Profile Path: \e\eBERSERKER\eprofile
87\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
88username: samba
89user ID/Group: 45/45
90user RID/GRID: 1090/1091
91Full Name: Test User
92Home Directory: \e\eBERSERKER\esamba
93HomeDir Drive:
94Logon Script:
95Profile Path: \e\eBERSERKER\eprofile
96.fi
97.if n \{\
98.RE
99.\}
100.RE
101.PP
102\-w|\-\-smbpasswd\-style
103.RS 4
104This option sets the "smbpasswd" listing format\&. It will make pdbedit list the users in the database, printing out the account fields in a format compatible with the
105smbpasswd
106file format\&. (see the
107\fBsmbpasswd\fR(5)
108for details)\&. Instead used together with (\-v) displays the passwords hashes in verbose output\&.
109.sp
110Example:
111pdbedit \-L \-w
112.sp
113.if n \{\
114.RS 4
115.\}
116.nf
117sorce:500:508818B733CE64BEAAD3B435B51404EE:
118 D2A2418EFC466A8A0F6B1DBB5C3DB80C:
119 [UX ]:LCT\-00000000:
120samba:45:0F2B255F7B67A7A9AAD3B435B51404EE:
121 BC281CE3F53B6A5146629CD4751D3490:
122 [UX ]:LCT\-3BFA1E8D:
123.fi
124.if n \{\
125.RE
126.\}
127.RE
128.PP
129\-u|\-\-user username
130.RS 4
131This option specifies the username to be used for the operation requested (listing, adding, removing)\&. It is
132\fIrequired\fR
133in add, remove and modify operations and
134\fIoptional\fR
135in list operations\&.
136.RE
137.PP
138\-f|\-\-fullname fullname
139.RS 4
140This option can be used while adding or modifying a user account\&. It will specify the user\*(Aqs full name\&.
141.sp
142Example:
143\-f "Simo Sorce"
144.RE
145.PP
146\-h|\-\-homedir homedir
147.RS 4
148This option can be used while adding or modifying a user account\&. It will specify the user\*(Aqs home directory network path\&.
149.sp
150Example:
151\-h "\e\e\e\eBERSERKER\e\esorce"
152.RE
153.PP
154\-D|\-\-drive drive
155.RS 4
156This option can be used while adding or modifying a user account\&. It will specify the windows drive letter to be used to map the home directory\&.
157.sp
158Example:
159\-D "H:"
160.RE
161.PP
162\-S|\-\-script script
163.RS 4
164This option can be used while adding or modifying a user account\&. It will specify the user\*(Aqs logon script path\&.
165.sp
166Example:
167\-S "\e\e\e\eBERSERKER\e\enetlogon\e\esorce\&.bat"
168.RE
169.PP
170\-\-set\-nt\-hash
171.RS 4
172This option can be used while modifying a user account\&. It will set the user\*(Aqs password using the nt\-hash value given as hexadecimal string\&. Useful to synchronize passwords\&.
173.sp
174Example:
175\-\-set\-nt\-hash 8846F7EAEE8FB117AD06BDD830B7586C
176.RE
177.PP
178\-p|\-\-profile profile
179.RS 4
180This option can be used while adding or modifying a user account\&. It will specify the user\*(Aqs profile directory\&.
181.sp
182Example:
183\-p "\e\e\e\eBERSERKER\e\enetlogon"
184.RE
185.PP
186\-M|\*(Aq\-\-machine SID\*(Aq SID|rid
187.RS 4
188This option can be used while adding or modifying a machine account\&. It will specify the machines\*(Aq new primary group SID (Security Identifier) or rid\&.
189.sp
190Example:
191\-M S\-1\-5\-21\-2447931902\-1787058256\-3961074038\-1201
192.RE
193.PP
194\-U|\*(Aq\-\-user SID\*(Aq SID|rid
195.RS 4
196This option can be used while adding or modifying a user account\&. It will specify the users\*(Aq new SID (Security Identifier) or rid\&.
197.sp
198Example:
199\-U S\-1\-5\-21\-2447931902\-1787058256\-3961074038\-5004
200.sp
201Example:
202\*(Aq\-\-user SID\*(Aq S\-1\-5\-21\-2447931902\-1787058256\-3961074038\-5004
203.sp
204Example:
205\-U 5004
206.sp
207Example:
208\*(Aq\-\-user SID\*(Aq 5004
209.RE
210.PP
211\-c|\-\-account\-control account\-control
212.RS 4
213This option can be used while adding or modifying a user account\&. It will specify the users\*(Aq account control property\&. Possible flags are listed below\&.
214.sp
215.RS 4
216.ie n \{\
217\h'-04'\(bu\h'+03'\c
218.\}
219.el \{\
220.sp -1
221.IP \(bu 2.3
222.\}
223N: No password required
224.RE
225.sp
226.RS 4
227.ie n \{\
228\h'-04'\(bu\h'+03'\c
229.\}
230.el \{\
231.sp -1
232.IP \(bu 2.3
233.\}
234D: Account disabled
235.RE
236.sp
237.RS 4
238.ie n \{\
239\h'-04'\(bu\h'+03'\c
240.\}
241.el \{\
242.sp -1
243.IP \(bu 2.3
244.\}
245H: Home directory required
246.RE
247.sp
248.RS 4
249.ie n \{\
250\h'-04'\(bu\h'+03'\c
251.\}
252.el \{\
253.sp -1
254.IP \(bu 2.3
255.\}
256T: Temporary duplicate of other account
257.RE
258.sp
259.RS 4
260.ie n \{\
261\h'-04'\(bu\h'+03'\c
262.\}
263.el \{\
264.sp -1
265.IP \(bu 2.3
266.\}
267U: Regular user account
268.RE
269.sp
270.RS 4
271.ie n \{\
272\h'-04'\(bu\h'+03'\c
273.\}
274.el \{\
275.sp -1
276.IP \(bu 2.3
277.\}
278M: MNS logon user account
279.RE
280.sp
281.RS 4
282.ie n \{\
283\h'-04'\(bu\h'+03'\c
284.\}
285.el \{\
286.sp -1
287.IP \(bu 2.3
288.\}
289W: Workstation Trust Account
290.RE
291.sp
292.RS 4
293.ie n \{\
294\h'-04'\(bu\h'+03'\c
295.\}
296.el \{\
297.sp -1
298.IP \(bu 2.3
299.\}
300S: Server Trust Account
301.RE
302.sp
303.RS 4
304.ie n \{\
305\h'-04'\(bu\h'+03'\c
306.\}
307.el \{\
308.sp -1
309.IP \(bu 2.3
310.\}
311L: Automatic Locking
312.RE
313.sp
314.RS 4
315.ie n \{\
316\h'-04'\(bu\h'+03'\c
317.\}
318.el \{\
319.sp -1
320.IP \(bu 2.3
321.\}
322X: Password does not expire
323.RE
324.sp
325.RS 4
326.ie n \{\
327\h'-04'\(bu\h'+03'\c
328.\}
329.el \{\
330.sp -1
331.IP \(bu 2.3
332.\}
333I: Domain Trust Account
334.RE
335.sp
336.RE
337.sp
338Example:
339\-c "[X ]"
340.RE
341.PP
342\-K|\-\-kickoff\-time
343.RS 4
344This option is used to modify the kickoff time for a certain user\&. Use "never" as argument to set the kickoff time to unlimited\&.
345.sp
346Example:
347pdbedit \-K never user
348.RE
349.PP
350\-a|\-\-create
351.RS 4
352This 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\&.
353.sp
354Example:
355pdbedit \-a \-u sorce
356.sp
357.if n \{\
358.RS 4
359.\}
360.nf
361new password:
362retype new password
363.fi
364.if n \{\
365.RE
366.\}
367.sp
368.if n \{\
369.sp
370.\}
371.RS 4
372.it 1 an-trap
373.nr an-no-space-flag 1
374.nr an-break-flag 1
375.br
376.ps +1
377\fBNote\fR
378.ps -1
379.br
380pdbedit does not call the unix password synchronization script if
381\m[blue]\fBunix password sync\fR\m[]
382has been set\&. It only updates the data in the Samba user database\&.
383.sp
384If you wish to add a user and synchronise the password that immediately, use
385smbpasswd\*(Aqs
386\fB\-a\fR
387option\&.
388.sp .5v
389.RE
390.RE
391.PP
392\-t|\-\-password\-from\-stdin
393.RS 4
394This option causes pdbedit to read the password from standard input, rather than from /dev/tty (like the
395passwd(1)
396program does)\&. The password has to be submitted twice and terminated by a newline each\&.
397.RE
398.PP
399\-r|\-\-modify
400.RS 4
401This option is used to modify an existing user in the database\&. This command needs a user name specified with the \-u switch\&. Other options can be specified to modify the properties of the specified user\&. This flag is kept for backwards compatibility, but it is no longer necessary to specify it\&.
402.RE
403.PP
404\-m|\-\-machine
405.RS 4
406This option may only be used in conjunction with the
407\fI\-a\fR
408option\&. It will make pdbedit to add a machine trust account instead of a user account (\-u username will provide the machine name)\&.
409.sp
410Example:
411pdbedit \-a \-m \-u w2k\-wks
412.RE
413.PP
414\-x|\-\-delete
415.RS 4
416This option causes pdbedit to delete an account from the database\&. It needs a username specified with the \-u switch\&.
417.sp
418Example:
419pdbedit \-x \-u bob
420.RE
421.PP
422\-i|\-\-import passdb\-backend
423.RS 4
424Use 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\&.
425.sp
426This option will ease migration from one passdb backend to another\&.
427.sp
428Example:
429pdbedit \-i smbpasswd:/etc/smbpasswd\&.old
430.RE
431.PP
432\-e|\-\-export passdb\-backend
433.RS 4
434Exports all currently available users to the specified password database backend\&.
435.sp
436This option will ease migration from one passdb backend to another and will ease backing up\&.
437.sp
438Example:
439pdbedit \-e smbpasswd:/root/samba\-users\&.backup
440.RE
441.PP
442\-g|\-\-group
443.RS 4
444If you specify
445\fI\-g\fR, then
446\fI\-i in\-backend \-e out\-backend\fR
447applies to the group mapping instead of the user database\&.
448.sp
449This option will ease migration from one passdb backend to another and will ease backing up\&.
450.RE
451.PP
452\-b|\-\-backend passdb\-backend
453.RS 4
454Use a different default passdb backend\&.
455.sp
456Example:
457pdbedit \-b xml:/root/pdb\-backup\&.xml \-l
458.RE
459.PP
460\-P|\-\-account\-policy account\-policy
461.RS 4
462Display an account policy
463.sp
464Valid 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\&.
465.sp
466Example:
467pdbedit \-P "bad lockout attempt"
468.sp
469.if n \{\
470.RS 4
471.\}
472.nf
473account policy value for bad lockout attempt is 0
474.fi
475.if n \{\
476.RE
477.\}
478.RE
479.PP
480\-C|\-\-value account\-policy\-value
481.RS 4
482Sets an account policy to a specified value\&. This option may only be used in conjunction with the
483\fI\-P\fR
484option\&.
485.sp
486Example:
487pdbedit \-P "bad lockout attempt" \-C 3
488.sp
489.if n \{\
490.RS 4
491.\}
492.nf
493account policy value for bad lockout attempt was 0
494account policy value for bad lockout attempt is now 3
495.fi
496.if n \{\
497.RE
498.\}
499.RE
500.PP
501\-y|\-\-policies
502.RS 4
503If you specify
504\fI\-y\fR, then
505\fI\-i in\-backend \-e out\-backend\fR
506applies to the account policies instead of the user database\&.
507.sp
508This option will allow one to migrate account policies from their default tdb\-store into a passdb backend, e\&.g\&. an LDAP directory server\&.
509.sp
510Example:
511pdbedit \-y \-i tdbsam: \-e ldapsam:ldap://my\&.ldap\&.host
512.RE
513.PP
514\-\-force\-initialized\-passwords
515.RS 4
516This option forces all users to change their password upon next login\&.
517.RE
518.PP
519\-N|\-\-account\-desc description
520.RS 4
521This option can be used while adding or modifying a user account\&. It will specify the user\*(Aqs description field\&.
522.sp
523Example:
524\-N "test description"
525.RE
526.PP
527\-Z|\-\-logon\-hours\-reset
528.RS 4
529This option can be used while adding or modifying a user account\&. It will reset the user\*(Aqs allowed logon hours\&. A user may login at any time afterwards\&.
530.sp
531Example:
532\-Z
533.RE
534.PP
535\-z|\-\-bad\-password\-count\-reset
536.RS 4
537This option can be used while adding or modifying a user account\&. It will reset the stored bad login counter from a specified user\&.
538.sp
539Example:
540\-z
541.RE
542.PP
543\-\-policies\-reset
544.RS 4
545This option can be used to reset the general password policies stored for a domain to their default values\&.
546.sp
547Example:
548\-\-policies\-reset
549.RE
550.PP
551\-I|\-\-domain
552.RS 4
553This option can be used while adding or modifying a user account\&. It will specify the user\*(Aqs domain field\&.
554.sp
555Example:
556\-I "MYDOMAIN"
557.RE
558.PP
559\-\-time\-format
560.RS 4
561This option is currently not being used\&.
562.RE
563.SH "NOTES"
564.PP
565This command may be used only by root\&.
566.SH "VERSION"
567.PP
568This man page is correct for version 3 of the Samba suite\&.
569.SH "SEE ALSO"
570.PP
571\fBsmbpasswd\fR(5),
572\fBsamba\fR(7)
573.SH "AUTHOR"
574.PP
575The 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\&.
576.PP
577The pdbedit manpage was written by Simo Sorce and Jelmer Vernooij\&.
Note: See TracBrowser for help on using the repository browser.