Document common arguments with entities
[abartlet/samba.git/.git] / docs / docbook / manpages / pdbedit.8.sgml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2 <!ENTITY % globalentities SYSTEM '../global.ent'> %globalentities;
3 ]>
4 <refentry id="pdbedit.8">
5
6 <refmeta>
7         <refentrytitle>pdbedit</refentrytitle>
8         <manvolnum>8</manvolnum>
9 </refmeta>
10
11
12 <refnamediv>
13         <refname>pdbedit</refname>
14         <refpurpose>manage the SAM database</refpurpose>
15 </refnamediv>
16
17 <refsynopsisdiv>
18         <cmdsynopsis>
19                 <command>pdbedit</command>
20                 <arg choice="opt">-l</arg>      
21                 <arg choice="opt">-v</arg>      
22                 <arg choice="opt">-w</arg>      
23                 <arg choice="opt">-u username</arg>     
24                 <arg choice="opt">-f fullname</arg>     
25                 <arg choice="opt">-h homedir</arg>      
26                 <arg choice="opt">-D drive</arg>        
27                 <arg choice="opt">-S script</arg>
28                 <arg choice="opt">-p profile</arg>      
29                 <arg choice="opt">-a</arg>      
30                 <arg choice="opt">-m</arg>      
31                 <arg choice="opt">-x</arg>      
32                 <arg choice="opt">-i passdb-backend</arg>       
33                 <arg choice="opt">-e passdb-backend</arg>   
34                 <arg choice="opt">-g</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         </cmdsynopsis>
42 </refsynopsisdiv>
43
44 <refsect1>
45         <title>DESCRIPTION</title>
46
47         <para>This tool is part of the <citerefentry><refentrytitle>Samba</refentrytitle>
48         <manvolnum>7</manvolnum></citerefentry> suite.</para>
49
50         <para>The pdbedit program is used to manage the users accounts
51         stored in the sam database and can only be run by root.</para>
52
53         <para>The pdbedit tool uses the passdb modular interface and is
54         independent from the kind of users database used (currently there
55         are smbpasswd, ldap, nis+ and tdb based and more can be added
56         without changing the tool).</para>
57
58         <para>There are five main ways to use pdbedit: adding a user account,
59         removing a user account, modifing a user account, listing user
60         accounts, importing users accounts.</para>
61 </refsect1>
62
63 <refsect1>
64         <title>OPTIONS</title>
65         <variablelist>
66                 <varlistentry>
67                 <term>-l</term>
68                 <listitem><para>This option lists all the user accounts
69                 present in the users database.
70                 This option prints a list of user/uid pairs separated by
71                 the ':' character.</para>
72                 <para>Example: <command>pdbedit -l</command></para>
73                 <para><screen>
74 sorce:500:Simo Sorce
75 samba:45:Test User
76 </screen></para>
77                 </listitem>
78                 </varlistentry>
79                 
80                 
81                 
82                 <varlistentry>
83                 <term>-v</term>
84                 <listitem><para>This option enables the verbose listing format.
85                 It causes pdbedit to list the users in the database, printing
86                 out the account fields in a descriptive format.</para>
87
88                 <para>Example: <command>pdbedit -l -v</command></para>
89                 <para><screen>
90 ---------------
91 username:       sorce
92 user ID/Group:  500/500
93 user RID/GRID:  2000/2001
94 Full Name:      Simo Sorce
95 Home Directory: \\BERSERKER\sorce
96 HomeDir Drive:  H:
97 Logon Script:   \\BERSERKER\netlogon\sorce.bat
98 Profile Path:   \\BERSERKER\profile
99 ---------------
100 username:       samba
101 user ID/Group:  45/45
102 user RID/GRID:  1090/1091
103 Full Name:      Test User
104 Home Directory: \\BERSERKER\samba
105 HomeDir Drive:  
106 Logon Script:   
107 Profile Path:   \\BERSERKER\profile
108 </screen></para>
109                 </listitem>
110                 </varlistentry>
111                 
112                 
113                 
114                 <varlistentry>
115                 <term>-w</term>
116                 <listitem><para>This option sets the "smbpasswd" listing format.
117                 It will make pdbedit list the users in the database, printing
118                 out the account fields in a format compatible with the
119                 <filename>smbpasswd</filename> file format. (see the
120                 <citerefentry><refentrytitle>smbpasswd</refentrytitle>
121                 <manvolnum>5</manvolnum></citerefentry> for details)</para>
122
123                 <para>Example: <command>pdbedit -l -w</command></para>
124                 <screen>
125 sorce:500:508818B733CE64BEAAD3B435B51404EE:D2A2418EFC466A8A0F6B1DBB5C3DB80C:[UX         ]:LCT-00000000:
126 samba:45:0F2B255F7B67A7A9AAD3B435B51404EE:BC281CE3F53B6A5146629CD4751D3490:[UX         ]:LCT-3BFA1E8D:
127 </screen>
128                 </listitem>
129                 </varlistentry>
130                 
131                 
132                 <varlistentry>
133                 <term>-u username</term>
134                 <listitem><para>This option specifies the username to be
135                 used for the operation requested (listing, adding, removing).
136                 It is <emphasis>required</emphasis> in add, remove and modify
137                 operations and <emphasis>optional</emphasis> in list
138                 operations.</para>
139                 </listitem>
140                 </varlistentry>
141
142                 <varlistentry>
143                 <term>-f fullname</term>
144                 <listitem><para>This option can be used while adding or
145                 modifing a user account. It will specify the user's full
146                 name. </para>
147
148                 <para>Example: <command>-f "Simo Sorce"</command></para>
149                 </listitem>
150                 </varlistentry>
151                 
152                 
153                 
154                 <varlistentry>
155                 <term>-h homedir</term>
156                 <listitem><para>This option can be used while adding or
157                 modifing a user account. It will specify the user's home
158                 directory network path.</para>
159
160                 <para>Example: <command>-h "\\\\BERSERKER\\sorce"</command>
161                 </para>
162                 </listitem>
163                 </varlistentry>
164                 
165                 <varlistentry>
166                 <term>-D drive</term>
167                 <listitem><para>This option can be used while adding or
168                 modifing a user account. It will specify the windows drive
169                 letter to be used to map the home directory.</para>
170
171                 <para>Example: <command>-d "H:"</command>
172                 </para>
173                 </listitem>
174                 </varlistentry>
175                 
176                 
177                 <varlistentry>
178                 <term>-S script</term>
179                 <listitem><para>This option can be used while adding or
180                 modifing a user account. It will specify the user's logon
181                 script path.</para>
182
183                 <para>Example: <command>-s "\\\\BERSERKER\\netlogon\\sorce.bat"</command>
184                 </para>
185                 </listitem>
186                 </varlistentry>
187                 
188                 
189                 <varlistentry>
190                 <term>-p profile</term>
191                 <listitem><para>This option can be used while adding or
192                 modifing a user account. It will specify the user's profile
193                 directory.</para>
194
195                 <para>Example: <command>-p "\\\\BERSERKER\\netlogon"</command>
196                 </para>
197                 </listitem>
198                 </varlistentry>
199                 
200                 
201                 <varlistentry>
202                 <term>-a</term>
203                 <listitem><para>This option is used to add a user into the
204                 database. This command needs a user name specified with
205                 the -u switch. When adding a new user, pdbedit will also
206                 ask for the password to be used.</para>
207
208                 <para>Example: <command>pdbedit -a -u sorce</command>
209 <programlisting>new password:
210 retype new password
211 </programlisting>
212 </para>
213                 </listitem>
214                 </varlistentry>
215                 
216                 
217                 
218                 <varlistentry>
219                 <term>-m</term>
220                 <listitem><para>This option may only be used in conjunction 
221                 with the <parameter>-a</parameter> option. It will make
222                 pdbedit to add a machine trust account instead of a user
223                 account (-u username will provide the machine name).</para>
224
225                 <para>Example: <command>pdbedit -a -m -u w2k-wks</command>
226                 </para>
227                 </listitem>
228                 </varlistentry>
229                 
230                 
231                 <varlistentry>
232                 <term>-x</term>
233                 <listitem><para>This option causes pdbedit to delete an account
234                 from the database. It needs a username specified with the
235                 -u switch.</para>
236
237                 <para>Example: <command>pdbedit -x -u bob</command></para>
238                 </listitem>
239                 </varlistentry>
240                 
241
242                 <varlistentry>
243                 <term>-i passdb-backend</term>
244                 <listitem><para>Use a different passdb backend to retrieve users
245                 than the one specified in smb.conf. Can be used to import data into
246                 your local user database.</para>
247
248                 <para>This option will ease migration from one passdb backend to
249                 another.</para>
250
251                 <para>Example: <command>pdbedit -i smbpasswd:/etc/smbpasswd.old
252                 </command></para>
253                 </listitem>
254                 </varlistentry>
255
256                 <varlistentry>
257                 <term>-e passdb-backend</term>
258                 <listitem><para>Exports all currently available users to the
259                 specified password database backend.</para>
260
261                 <para>This option will ease migration from one passdb backend to
262                 another and will ease backing up.</para>
263                 
264                 <para>Example: <command>pdbedit -e smbpasswd:/root/samba-users.backup</command></para>
265                 </listitem>
266                 </varlistentry>
267
268                 <varlistentry>
269                 <term>-g</term>
270                 <listitem><para>If you specify <parameter>-g</parameter>,
271                 then <parameter>-i in-backend -e out-backend</parameter>
272                 applies to the group mapping instead of the user database.
273
274                 <para>This option will ease migration from one passdb backend to
275                 another and will ease backing up.</para>
276                 
277                 </listitem>
278                 </varlistentry>
279
280                 <varlistentry>
281                 <term>-g</term>
282                 <listitem><para>If you specify <parameter>-g</parameter>,
283                 then <parameter>-i in-backend -e out-backend</parameter>
284                 applies to the group mapping instead of the user database.
285
286                 <para>This option will ease migration from one passdb backend to
287                 another and will ease backing up.</para>
288                 
289                 </listitem>
290                 </varlistentry>
291
292                 <varlistentry>
293                 <term>-b passdb-backend</term>
294                 <listitem><para>Use a different default passdb backend. </para>
295
296                 <para>Example: <command>pdbedit -b xml:/root/pdb-backup.xml -l</command></para>
297                 </listitem>
298                 </varlistentry>
299
300                 <varlistentry>
301                 <term>-P account-policy</term>
302                 <listitem><para>Display an account policy</para>
303                 <para>Valid policies are: minimum password age, reset count minutes, disconnect time,
304                 user must logon to change password, password history, lockout duration, min password length,
305                 maximum password age and bad lockout attempt.</para>
306
307                 <para>Example: <command>pdbedit -P "bad lockout attempt"</command></para>
308 <para><programlisting>
309 account policy value for bad lockout attempt is 0
310 </programlisting></para>
311
312                 </listitem>
313                 </varlistentry>
314
315                 <varlistentry>
316                 <term>-C account-policy-value</term>
317                 <listitem><para>Sets an account policy to a specified value. 
318                 This option may only be used in conjunction
319                 with the <parameter>-P</parameter> option.
320                 </para>
321
322                 <para>Example: <command>pdbedit -P "bad lockout attempt" -C 3</command></para>
323 <para><programlisting>
324 account policy value for bad lockout attempt was 0
325 account policy value for bad lockout attempt is now 3
326 </programlisting></para>
327                 </listitem>
328                 </varlistentry>
329                 
330                 &stdarg.help;
331                 &popt.common.samba;
332
333         </variablelist>
334 </refsect1>
335
336
337 <refsect1>
338         <title>NOTES</title>
339         
340         <para>This command may be used only by root.</para>
341 </refsect1>
342
343
344 <refsect1>
345         <title>VERSION</title>
346
347         <para>This man page is correct for version 2.2 of 
348         the Samba suite.</para>
349 </refsect1>
350
351 <refsect1>
352         <title>SEE ALSO</title>
353         <para><citerefentry><refentrytitle>smbpasswd</refentrytitle>
354         <manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>samba</refentrytitle>
355         <manvolnum>7</manvolnum></citerefentry></para>
356 </refsect1>
357
358 <refsect1>
359         <title>AUTHOR</title>
360         
361         <para>The original Samba software and related utilities 
362         were created by Andrew Tridgell. Samba is now developed
363         by the Samba Team as an Open Source project similar 
364         to the way the Linux kernel is developed.</para>
365         
366         <para>The original Samba man pages were written by Karl Auer. 
367         The man page sources were converted to YODL format (another 
368         excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
369         ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 
370         release by Jeremy Allison.  The conversion to DocBook for 
371         Samba 2.2 was done by Gerald Carter. The conversion to DocBook
372         XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.</para>
373 </refsect1>
374
375 </refentry>