Add more content to the description of "registry shares".
[Samba/bjacke.git] / docs / manpages-3 / pdbedit.8.xml
blobaaa42b064a19153b3244a72b3e01c56ab9b8fbad
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="pdbedit.8">
5 <refmeta>
6         <refentrytitle>pdbedit</refentrytitle>
7         <manvolnum>8</manvolnum>
8 </refmeta>
11 <refnamediv>
12         <refname>pdbedit</refname>
13         <refpurpose>manage the SAM database (Database of Samba Users)</refpurpose>
14 </refnamediv>
16 <refsynopsisdiv>
17         <cmdsynopsis>
18                 <command>pdbedit</command>
19                 <arg choice="opt">-L</arg>      
20                 <arg choice="opt">-v</arg>      
21                 <arg choice="opt">-w</arg>      
22                 <arg choice="opt">-u username</arg>     
23                 <arg choice="opt">-f fullname</arg>     
24                 <arg choice="opt">-h homedir</arg>      
25                 <arg choice="opt">-D drive</arg>        
26                 <arg choice="opt">-S script</arg>
27                 <arg choice="opt">-p profile</arg>      
28                 <arg choice="opt">-a</arg>      
29                 <arg choice="opt">-t, --password-from-stdin</arg>
30                 <arg choice="opt">-m</arg>      
31                 <arg choice="opt">-r</arg>      
32                 <arg choice="opt">-x</arg>      
33                 <arg choice="opt">-i passdb-backend</arg>       
34                 <arg choice="opt">-e passdb-backend</arg>   
35                 <arg choice="opt">-b passdb-backend</arg>
36                 <arg choice="opt">-g</arg>
37                 <arg choice="opt">-d debuglevel</arg>
38                 <arg choice="opt">-s configfile</arg>
39                 <arg choice="opt">-P account-policy</arg>
40                 <arg choice="opt">-C value</arg>
41                 <arg choice="opt">-c account-control</arg>
42                 <arg choice="opt">-y</arg>
43         </cmdsynopsis>
44 </refsynopsisdiv>
46 <refsect1>
47         <title>DESCRIPTION</title>
49         <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
50         <manvolnum>7</manvolnum></citerefentry> suite.</para>
52         <para>The pdbedit program is used to manage the users accounts
53         stored in the sam database and can only be run by root.</para>
55         <para>The pdbedit tool uses the passdb modular interface and is
56         independent from the kind of users database used (currently there
57         are smbpasswd, ldap, nis+ and tdb based and more can be added
58         without changing the tool).</para>
60         <para>There are five main ways to use pdbedit: adding a user account,
61         removing a user account, modifing a user account, listing user
62         accounts, importing users accounts.</para>
63 </refsect1>
65 <refsect1>
66         <title>OPTIONS</title>
67         <variablelist>
68                 <varlistentry>
69                 <term>-L</term>
70                 <listitem><para>This option lists all the user accounts
71                 present in the users database.
72                 This option prints a list of user/uid pairs separated by
73                 the ':' character.</para>
74                 <para>Example: <command>pdbedit -L</command></para>
75                 <para><programlisting>
76 sorce:500:Simo Sorce
77 samba:45:Test User
78 </programlisting></para>
79                 </listitem>
80                 </varlistentry>
81                 
82                 
83                 
84                 <varlistentry>
85                 <term>-v</term>
86                 <listitem><para>This option enables the verbose listing format.
87                 It causes pdbedit to list the users in the database, printing
88                 out the account fields in a descriptive format.</para>
90                 <para>Example: <command>pdbedit -L -v</command></para>
91                 <para><programlisting>
92 ---------------
93 username:       sorce
94 user ID/Group:  500/500
95 user RID/GRID:  2000/2001
96 Full Name:      Simo Sorce
97 Home Directory: \\BERSERKER\sorce
98 HomeDir Drive:  H:
99 Logon Script:   \\BERSERKER\netlogon\sorce.bat
100 Profile Path:   \\BERSERKER\profile
101 ---------------
102 username:       samba
103 user ID/Group:  45/45
104 user RID/GRID:  1090/1091
105 Full Name:      Test User
106 Home Directory: \\BERSERKER\samba
107 HomeDir Drive:  
108 Logon Script:   
109 Profile Path:   \\BERSERKER\profile
110 </programlisting></para>
111                 </listitem>
112                 </varlistentry>
113                 
114                 
115                 
116                 <varlistentry>
117                 <term>-w</term>
118                 <listitem><para>This option sets the "smbpasswd" listing format.
119                 It will make pdbedit list the users in the database, printing
120                 out the account fields in a format compatible with the
121                 <filename>smbpasswd</filename> file format. (see the
122                 <citerefentry><refentrytitle>smbpasswd</refentrytitle>
123                 <manvolnum>5</manvolnum></citerefentry> for details)</para>
125                 <para>Example: <command>pdbedit -L -w</command></para>
126                 <programlisting>
127 sorce:500:508818B733CE64BEAAD3B435B51404EE:
128           D2A2418EFC466A8A0F6B1DBB5C3DB80C:
129           [UX         ]:LCT-00000000:
130 samba:45:0F2B255F7B67A7A9AAD3B435B51404EE:
131           BC281CE3F53B6A5146629CD4751D3490:
132           [UX         ]:LCT-3BFA1E8D:
133 </programlisting>
134                 </listitem>
135                 </varlistentry>
136                 
137                 
138                 <varlistentry>
139                 <term>-u username</term>
140                 <listitem><para>This option specifies the username to be
141                 used for the operation requested (listing, adding, removing).
142                 It is <emphasis>required</emphasis> in add, remove and modify
143                 operations and <emphasis>optional</emphasis> in list
144                 operations.</para>
145                 </listitem>
146                 </varlistentry>
148                 <varlistentry>
149                 <term>-f fullname</term>
150                 <listitem><para>This option can be used while adding or
151                 modifing a user account. It will specify the user's full
152                 name. </para>
154                 <para>Example: <command>-f "Simo Sorce"</command></para>
155                 </listitem>
156                 </varlistentry>
157                 
158                 <varlistentry>
159                 <term>-h homedir</term>
160                 <listitem><para>This option can be used while adding or
161                 modifing a user account. It will specify the user's home
162                 directory network path.</para>
164                 <para>Example: <command>-h "\\\\BERSERKER\\sorce"</command>
165                 </para>
166                 </listitem>
167                 </varlistentry>
168                 
169                 <varlistentry>
170                 <term>-D drive</term>
171                 <listitem><para>This option can be used while adding or
172                 modifing a user account. It will specify the windows drive
173                 letter to be used to map the home directory.</para>
175                 <para>Example: <command>-D "H:"</command>
176                 </para>
177                 </listitem>
178                 </varlistentry>
179                 
180                 
181                 <varlistentry>
182                 <term>-S script</term>
183                 <listitem><para>This option can be used while adding or
184                 modifing a user account. It will specify the user's logon
185                 script path.</para>
187                 <para>Example: <command>-S "\\\\BERSERKER\\netlogon\\sorce.bat"</command>
188                 </para>
189                 </listitem>
190                 </varlistentry>
191                 
192                 
193                 <varlistentry>
194                 <term>-p profile</term>
195                 <listitem><para>This option can be used while adding or
196                 modifing a user account. It will specify the user's profile
197                 directory.</para>
199                 <para>Example: <command>-p "\\\\BERSERKER\\netlogon"</command>
200                 </para>
201                 </listitem>
202                 </varlistentry>
204                 <varlistentry>
205                 <term>-G SID|rid</term>
206                 <listitem><para>
207                 This option can be used while adding or modifying a user account. It 
208                 will specify the users' new primary group SID (Security Identifier) or 
209                 rid. </para>
211                 <para>Example: <command>-G S-1-5-21-2447931902-1787058256-3961074038-1201</command></para>
212                 </listitem>
213                 </varlistentry>
215                 <varlistentry>
216                 <term>-U SID|rid</term>
217                 <listitem><para>
218                 This option can be used while adding or modifying a user account. It 
219                 will specify the users' new SID (Security Identifier) or 
220                 rid. </para>
222                 <para>Example: <command>-U S-1-5-21-2447931902-1787058256-3961074038-5004</command></para>
223                 </listitem>
224                 </varlistentry>
226                 <varlistentry>
227                 <term>-c account-control</term>
228                 <listitem><para>This option can be used while adding or modifying a user
229                                 account. It will specify the users' account control property. Possible flags are listed below.
230         </para>
232         <para>
233                 <itemizedlist>
234                         <listitem><para>N: No password required</para></listitem>
235                         <listitem><para>D: Account disabled</para></listitem>
236                         <listitem><para>H: Home directory required</para></listitem>
237                         <listitem><para>T: Temporary duplicate of other account</para></listitem>
238                         <listitem><para>U: Regular user account</para></listitem>
239                         <listitem><para>M: MNS logon user account</para></listitem>
240                         <listitem><para>W: Workstation Trust Account</para></listitem>
241                         <listitem><para>S: Server Trust Account</para></listitem>
242                         <listitem><para>L: Automatic Locking</para></listitem>
243                         <listitem><para>X: Password does not expire</para></listitem>
244                         <listitem><para>I: Domain Trust Account</para></listitem>
245                 </itemizedlist>
246         </para>
248                 <para>Example: <command>-c "[X          ]"</command></para>
249                 </listitem>
250                 </varlistentry>
252                 <varlistentry>
253                 <term>-a</term>
254                 <listitem><para>This option is used to add a user into the
255                 database. This command needs a user name specified with
256                 the -u switch. When adding a new user, pdbedit will also
257                 ask for the password to be used.</para>
259                 <para>Example: <command>pdbedit -a -u sorce</command>
260 <programlisting>new password:
261 retype new password
262 </programlisting>
263 </para>
265                 <note><para>pdbedit does not call the unix password syncronisation 
266                                 script if <smbconfoption name="unix password sync"/>
267                                 has been set. It only updates the data in the Samba 
268                                 user database. 
269                         </para>
271                         <para>If you wish to add a user and synchronise the password
272                                 that immediately, use <command>smbpasswd</command>'s <option>-a</option> option.
273                         </para>
274                 </note>
275                 </listitem>
276                 </varlistentry>
277                 
278                 <varlistentry>
279                 <term>-t, --password-from-stdin</term>
280                 <listitem><para>This option causes pdbedit to read the password
281                 from standard input, rather than from /dev/tty (like the
282                 <command>passwd(1)</command> program does).  The password has
283                 to be submitted twice and terminated by a newline each.</para>
284                 </listitem>
285                 </varlistentry>
287                 <varlistentry>
288                 <term>-r</term>
289                 <listitem><para>This option is used to modify an existing user 
290                 in the database. This command needs a user name specified with the -u 
291                 switch. Other options can be specified to modify the properties of 
292                 the specified user. This flag is kept for backwards compatibility, but 
293                 it is no longer necessary to specify it.
294                 </para></listitem>
295                 </varlistentry>
296                         
297                 <varlistentry>
298                 <term>-m</term>
299                 <listitem><para>This option may only be used in conjunction 
300                 with the <parameter>-a</parameter> option. It will make
301                 pdbedit to add a machine trust account instead of a user
302                 account (-u username will provide the machine name).</para>
304                 <para>Example: <command>pdbedit -a -m -u w2k-wks</command>
305                 </para>
306                 </listitem>
307                 </varlistentry>
308                 
309                 
310                 <varlistentry>
311                 <term>-x</term>
312                 <listitem><para>This option causes pdbedit to delete an account
313                 from the database. It needs a username specified with the
314                 -u switch.</para>
316                 <para>Example: <command>pdbedit -x -u bob</command></para>
317                 </listitem>
318                 </varlistentry>
319                 
321                 <varlistentry>
322                 <term>-i passdb-backend</term>
323                 <listitem><para>Use a different passdb backend to retrieve users
324                 than the one specified in smb.conf. Can be used to import data into
325                 your local user database.</para>
327                 <para>This option will ease migration from one passdb backend to
328                 another.</para>
330                 <para>Example: <command>pdbedit -i smbpasswd:/etc/smbpasswd.old
331                 </command></para>
332                 </listitem>
333                 </varlistentry>
335                 <varlistentry>
336                 <term>-e passdb-backend</term>
337                 <listitem><para>Exports all currently available users to the
338                 specified password database backend.</para>
340                 <para>This option will ease migration from one passdb backend to
341                 another and will ease backing up.</para>
342                 
343                 <para>Example: <command>pdbedit -e smbpasswd:/root/samba-users.backup</command></para>
344                 </listitem>
345                 </varlistentry>
347                 <varlistentry>
348                 <term>-g</term>
349                 <listitem><para>If you specify <parameter>-g</parameter>,
350                 then <parameter>-i in-backend -e out-backend</parameter>
351                 applies to the group mapping instead of the user database.</para>
353                 <para>This option will ease migration from one passdb backend to
354                 another and will ease backing up.</para>
355                 
356                 </listitem>
357                 </varlistentry>
359                 <varlistentry>
360                 <term>-b passdb-backend</term>
361                 <listitem><para>Use a different default passdb backend. </para>
363                 <para>Example: <command>pdbedit -b xml:/root/pdb-backup.xml -l</command></para>
364                 </listitem>
365                 </varlistentry>
367                 <varlistentry>
368                 <term>-P account-policy</term>
369                 <listitem><para>Display an account policy</para>
370                 <para>Valid policies are: minimum password age, reset count minutes, disconnect time,
371                 user must logon to change password, password history, lockout duration, min password length,
372                 maximum password age and bad lockout attempt.</para>
374                 <para>Example: <command>pdbedit -P "bad lockout attempt"</command></para>
375 <para><programlisting>
376 account policy value for bad lockout attempt is 0
377 </programlisting></para>
379                 </listitem>
380                 </varlistentry>
383                 <varlistentry>
384                 <term>-C account-policy-value</term>
385                 <listitem><para>Sets an account policy to a specified value. 
386                 This option may only be used in conjunction
387                 with the <parameter>-P</parameter> option.
388                 </para>
390                 <para>Example: <command>pdbedit -P "bad lockout attempt" -C 3</command></para>
391 <para><programlisting>
392 account policy value for bad lockout attempt was 0
393 account policy value for bad lockout attempt is now 3
394 </programlisting></para>
395                 </listitem>
396                 </varlistentry>
398                 <varlistentry>
399                 <term>-y</term>
400                 <listitem><para>If you specify <parameter>-y</parameter>,
401                 then <parameter>-i in-backend -e out-backend</parameter>
402                 applies to the account policies instead of the user database.</para>
404                 <para>This option will allow to migrate account policies from their default
405                 tdb-store into a passdb backend, e.g. an LDAP directory server.</para>
407                 <para>Example: <command>pdbedit -y -i tdbsam: -e ldapsam:ldap://my.ldap.host</command></para>
408         
409                 </listitem>
410                 </varlistentry>
412                 &stdarg.help;
413                 &stdarg.server.debug;
414                 &popt.common.samba;
416         </variablelist>
417 </refsect1>
420 <refsect1>
421         <title>NOTES</title>
422         
423         <para>This command may be used only by root.</para>
424 </refsect1>
427 <refsect1>
428         <title>VERSION</title>
430         <para>This man page is correct for version 3.0 of 
431         the Samba suite.</para>
432 </refsect1>
434 <refsect1>
435         <title>SEE ALSO</title>
436         <para><citerefentry><refentrytitle>smbpasswd</refentrytitle>
437         <manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>samba</refentrytitle>
438         <manvolnum>7</manvolnum></citerefentry></para>
439 </refsect1>
441 <refsect1>
442         <title>AUTHOR</title>
443         
444         <para>The original Samba software and related utilities 
445         were created by Andrew Tridgell. Samba is now developed
446         by the Samba Team as an Open Source project similar 
447         to the way the Linux kernel is developed.</para>
449         <para>The pdbedit manpage was written by Simo Sorce and Jelmer Vernooij.</para>
451 </refsect1>
453 </refentry>