Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / userdel.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1991 - 1994, Julianne Frances Haugh
4    Copyright (c) 2007 - 2009, Nicolas François
5    All rights reserved.
6   
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions
9    are met:
10    1. Redistributions of source code must retain the above copyright
11       notice, this list of conditions and the following disclaimer.
12    2. Redistributions in binary form must reproduce the above copyright
13       notice, this list of conditions and the following disclaimer in the
14       documentation and/or other materials provided with the distribution.
15    3. The name of the copyright holders or contributors may not be used to
16       endorse or promote products derived from this software without
17       specific prior written permission.
18   
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
23    HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 -->
31 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
32   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
33 <!ENTITY MAIL_DIR              SYSTEM "login.defs.d/MAIL_DIR.xml">
34 <!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
35 <!ENTITY USERDEL_CMD           SYSTEM "login.defs.d/USERDEL_CMD.xml">
36 <!ENTITY USERGROUPS_ENAB       SYSTEM "login.defs.d/USERGROUPS_ENAB.xml">
37 ]>
38 <refentry id='userdel.8'>
39   <!-- $Id: userdel.8.xml 2964 2009-05-21 12:02:12Z nekral-guest $ -->
40   <refmeta>
41     <refentrytitle>userdel</refentrytitle>
42     <manvolnum>8</manvolnum>
43     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
44   </refmeta>
45   <refnamediv id='name'>
46     <refname>userdel</refname>
47     <refpurpose>delete a user account and related files</refpurpose>
48   </refnamediv>
49   <refsynopsisdiv id='synopsis'>
50     <cmdsynopsis>
51       <command>userdel</command>
52       <arg choice='opt'>options</arg>
53       <arg choice='plain'>
54         <replaceable>LOGIN</replaceable>
55       </arg>
56     </cmdsynopsis>
57   </refsynopsisdiv>
58
59   <refsect1 id='description'>
60     <title>DESCRIPTION</title>
61     <para>
62       The <command>userdel</command> command modifies the system account
63       files, deleting all entries that refer to the user name <emphasis
64       remap='I'>LOGIN</emphasis>. The named user must exist.
65     </para>
66   </refsect1>
67
68   <refsect1 id='options'>
69     <title>OPTIONS</title>
70     <para>
71       The options which apply to the <command>userdel</command> command are:
72     </para>
73     <variablelist remap='IP'>
74       <varlistentry>
75         <term>
76           <option>-f</option>, <option>--force</option>
77         </term>
78         <listitem>
79           <para>
80             This option forces the removal of the user account, even if the
81             user is still
82             logged in. It also forces <command>userdel</command> to remove
83             the user's home directory and mail spool, even if another
84             user uses the same home directory or if the mail spool is not
85             owned by the specified user.  If
86             <option>USERGROUPS_ENAB</option> is defined to <emphasis
87             remap='I'>yes</emphasis> in <filename>/etc/login.defs</filename>
88             and if a group exists with the same name as the deleted user,
89             then this group will be removed, even if it is still the primary
90             group of another user.
91           </para>
92           <para>
93             <emphasis>Note:</emphasis> This option is dangerous and may leave
94             your system in an inconsistent state.
95           </para>
96         </listitem>
97       </varlistentry>
98       <varlistentry>
99         <term><option>-h</option>, <option>--help</option></term>
100           <listitem>
101             <para>Display help message and exit.</para>
102           </listitem>
103       </varlistentry>
104       <varlistentry>
105         <term>
106           <option>-r</option>, <option>--remove</option>
107         </term>
108         <listitem>
109           <para>
110             Files in the user's home directory will be removed along with
111             the home directory itself and the user's mail spool. Files
112             located in other file systems will have to be searched for and
113             deleted manually.
114           </para>
115           <para>
116             The mail spool is defined by the <option>MAIL_DIR</option>
117             variable in the <filename>login.defs</filename> file.
118           </para>
119         </listitem>
120       </varlistentry>
121     </variablelist>
122   </refsect1>
123
124   <refsect1 id='configuration'>
125     <title>CONFIGURATION</title>
126     <para>
127       The following configuration variables in
128       <filename>/etc/login.defs</filename> change the behavior of this
129       tool:
130     </para>
131     <variablelist>
132       &MAIL_DIR; <!-- documents also MAIL_FILE -->
133       &MAX_MEMBERS_PER_GROUP;
134       &USERDEL_CMD;
135       &USERGROUPS_ENAB;
136     </variablelist>
137   </refsect1>
138
139   <refsect1 id='files'>
140     <title>FILES</title>
141     <variablelist>
142       <varlistentry>
143         <term><filename>/etc/group</filename></term>
144         <listitem>
145           <para>Group account information.</para>
146         </listitem>
147       </varlistentry>
148       <varlistentry>
149         <term><filename>/etc/login.defs</filename></term>
150         <listitem>
151           <para>Shadow password suite configuration.</para>
152         </listitem>
153       </varlistentry>
154       <varlistentry>
155         <term><filename>/etc/passwd</filename></term>
156         <listitem>
157           <para>User account information.</para>
158         </listitem>
159       </varlistentry>
160       <varlistentry>
161         <term><filename>/etc/shadow</filename></term>
162         <listitem>
163           <para>Secure user account information.</para>
164         </listitem>
165       </varlistentry>
166     </variablelist>
167   </refsect1>
168
169   <refsect1 id='exit_values'>
170     <title>EXIT VALUES</title>
171     <para>
172       The <command>userdel</command> command exits with the following values:
173       <variablelist>
174         <varlistentry>
175           <term><replaceable>0</replaceable></term>
176           <listitem>
177             <para>success</para>
178           </listitem>
179         </varlistentry>
180         <varlistentry>
181           <term><replaceable>1</replaceable></term>
182           <listitem>
183             <para>can't update password file</para>
184           </listitem>
185         </varlistentry>
186         <varlistentry>
187           <term><replaceable>2</replaceable></term>
188           <listitem>
189             <para>invalid command syntax</para>
190           </listitem>
191         </varlistentry>
192         <varlistentry>
193           <term><replaceable>6</replaceable></term>
194           <listitem>
195             <para>specified user doesn't exist</para>
196           </listitem>
197         </varlistentry>
198         <varlistentry>
199           <term><replaceable>8</replaceable></term>
200           <listitem>
201             <para>user currently logged in</para>
202           </listitem>
203         </varlistentry>
204         <varlistentry>
205           <term><replaceable>10</replaceable></term>
206           <listitem>
207             <para>can't update group file</para>
208           </listitem>
209         </varlistentry>
210         <varlistentry>
211           <term><replaceable>12</replaceable></term>
212           <listitem>
213             <para>can't remove home directory</para>
214           </listitem>
215         </varlistentry>
216       </variablelist>
217     </para>
218   </refsect1>
219
220   <refsect1 id='caveats'>
221     <title>CAVEATS</title>
222     <para>
223       <command>userdel</command> will not allow you to remove an account if
224       there are running processes which belong to this account. In that
225       case, you may have to kill those processes or lock the user's
226       password or account and remove the account later. The
227       <option>-f</option> option can force the deletion of this account.
228     </para>
229     <para>
230       You should manually check all file systems to ensure that no files
231       remain owned by this user.
232     </para>
233     <para>You may not remove any NIS attributes on a NIS client. This must
234       be performed on the NIS server.
235     </para>
236     <para>If <option>USERGROUPS_ENAB</option> is defined to <emphasis
237       remap='I'>yes</emphasis> in <filename>/etc/login.defs</filename>,
238       <command>userdel</command> will delete the group with the same name
239       as the user. To avoid inconsistencies in the passwd and group
240       databases, <command>userdel</command> will check that this group is
241       not used as a primary group for another user, and will just warn
242       without deleting the group otherwise. The <option>-f</option> option
243       can force the deletion of this group.
244     </para>
245   </refsect1>
246
247   <refsect1 id='see_also'>
248     <title>SEE ALSO</title>
249     <para><citerefentry>
250         <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
251       </citerefentry>,
252       <citerefentry>
253         <refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum>
254       </citerefentry>,
255       <citerefentry>
256         <refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
257       </citerefentry>,
258       <citerefentry>
259         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
260       </citerefentry>,
261       <citerefentry>
262         <refentrytitle>gpasswd</refentrytitle><manvolnum>8</manvolnum>
263       </citerefentry>,
264       <citerefentry>
265         <refentrytitle>groupadd</refentrytitle><manvolnum>8</manvolnum>
266       </citerefentry>,
267       <citerefentry>
268         <refentrytitle>groupdel</refentrytitle><manvolnum>8</manvolnum>
269       </citerefentry>,
270       <citerefentry>
271         <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
272       </citerefentry>,
273       <citerefentry>
274         <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
275       </citerefentry>,
276       <citerefentry>
277         <refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>
278       </citerefentry>.
279     </para>
280   </refsect1>
281 </refentry>