Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / sv / userdel.8
1 '\" t
2 .\"     Title: userdel
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5 .\"      Date: 16-02-2011
6 .\"    Manual: Systemhanteringskommandon
7 .\"    Source: Systemhanteringskommandon
8 .\"  Language: Swedish
9 .\"
10 .TH "USERDEL" "8" "16-02-2011" "Systemhanteringskommandon" "Systemhanteringskommandon"
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 "NAMN"
31 userdel \- ta bort ett anv\(:andarkonto och relaterade filer
32 .SH "SYNOPSIS"
33 .HP \w'\fBuserdel\fR\ 'u
34 \fBuserdel\fR [flaggor] \fIINLOGGNINGSNAMN\fR
35 .SH "BESKRIVNING"
36 .PP
37 The
38 \fBuserdel\fR
39 command modifies the system account files, deleting all entries that refer to the user name
40 \fILOGIN\fR\&. The named user must exist\&.
41 .SH "FLAGGOR"
42 .PP
43 Flaggorna som g\(:aller f\(:or kommandot
44 \fBuserdel\fR
45 \(:ar:
46 .PP
47 \fB\-f\fR, \fB\-\-force\fR
48 .RS 4
49 This option forces the removal of the user account, even if the user is still logged in\&. It also forces
50 \fBuserdel\fR
51 to remove the user\*(Aqs home directory and mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user\&. If
52 \fBUSERGROUPS_ENAB\fR
53 is defined to
54 \fIyes\fR
55 in
56 /etc/login\&.defs
57 and if a group exists with the same name as the deleted user, then this group will be removed, even if it is still the primary group of another user\&.
58 .sp
59 \fINotera:\fR
60 Denna flagga \(:ar farlig och kan g\(:ora att ditt system f\(:ors\(:atts i ett inkonsistent tillst\(oand\&.
61 .RE
62 .PP
63 \fB\-h\fR, \fB\-\-help\fR
64 .RS 4
65 Visa hj\(:alpmeddelande och avsluta\&.
66 .RE
67 .PP
68 \fB\-r\fR, \fB\-\-remove\fR
69 .RS 4
70 Files in the user\*(Aqs home directory will be removed along with the home directory itself and the user\*(Aqs mail spool\&. Files located in other file systems will have to be searched for and deleted manually\&.
71 .sp
72 The mail spool is defined by the
73 \fBMAIL_DIR\fR
74 variable in the
75 login\&.defs
76 file\&.
77 .RE
78 .SH "CONFIGURATION"
79 .PP
80 The following configuration variables in
81 /etc/login\&.defs
82 change the behavior of this tool:
83 .PP
84 \fBMAIL_DIR\fR (string)
85 .RS 4
86 The mail spool directory\&. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted\&. If not specified, a compile\-time default is used\&.
87 .RE
88 .PP
89 \fBMAIL_FILE\fR (string)
90 .RS 4
91 Defines the location of the users mail spool files relatively to their home directory\&.
92 .RE
93 .PP
94 The
95 \fBMAIL_DIR\fR
96 and
97 \fBMAIL_FILE\fR
98 variables are used by
99 \fBuseradd\fR,
100 \fBusermod\fR, and
101 \fBuserdel\fR
102 to create, move, or delete the user\*(Aqs mail spool\&.
103 .PP
104 If
105 \fBMAIL_CHECK_ENAB\fR
106 is set to
107 \fIyes\fR, they are also used to define the
108 \fBMAIL\fR
109 environment variable\&.
110 .PP
111 \fBMAX_MEMBERS_PER_GROUP\fR (number)
112 .RS 4
113 Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in
114 /etc/group
115 (with the same name, same password, and same GID)\&.
116 .sp
117 The default value is 0, meaning that there are no limits in the number of members in a group\&.
118 .sp
119 This feature (split group) permits to limit the length of lines in the group file\&. This is useful to make sure that lines for NIS groups are not larger than 1024 characters\&.
120 .sp
121 If you need to enforce such limit, you can use 25\&.
122 .sp
123 Note: split groups may not be supported by all tools (even in the Shadow toolsuite)\&. You should not use this variable unless you really need it\&.
124 .RE
125 .PP
126 \fBUSERDEL_CMD\fR (string)
127 .RS 4
128 If defined, this command is run when removing a user\&. It should remove any at/cron/print jobs etc\&. owned by the user to be removed (passed as the first argument)\&.
129 .sp
130 The return code of the script is not taken into account\&.
131 .sp
132 Here is an example script, which removes the user\*(Aqs cron, at and print jobs:
133 .sp
134 .if n \{\
135 .RS 4
136 .\}
137 .nf
138 #! /bin/sh
139
140 # Check for the required argument\&.
141 if [ $# != 1 ]; then
142         echo "Usage: $0 username"
143         exit 1
144 fi
145
146 # Remove cron jobs\&.
147 crontab \-r \-u $1
148
149 # Remove at jobs\&.
150 # Note that it will remove any jobs owned by the same UID,
151 # even if it was shared by a different username\&.
152 AT_SPOOL_DIR=/var/spool/cron/atjobs
153 find $AT_SPOOL_DIR \-name "[^\&.]*" \-type f \-user $1 \-delete \e;
154
155 # Remove print jobs\&.
156 lprm $1
157
158 # All done\&.
159 exit 0
160       
161 .fi
162 .if n \{\
163 .RE
164 .\}
165 .sp
166 .RE
167 .PP
168 \fBUSERGROUPS_ENAB\fR (boolean)
169 .RS 4
170 Enable setting of the umask group bits to be the same as owner bits (examples: 022 \-> 002, 077 \-> 007) for non\-root users, if the uid is the same as gid, and username is the same as the primary group name\&.
171 .sp
172 If set to
173 \fIyes\fR,
174 \fBuserdel\fR
175 will remove the user\*(Aqs group if it contains no more members, and
176 \fBuseradd\fR
177 will create by default a group with the name of the user\&.
178 .RE
179 .SH "FILER"
180 .PP
181 /etc/group
182 .RS 4
183 Gruppkontoinformation\&.
184 .RE
185 .PP
186 /etc/login\&.defs
187 .RS 4
188 Shadow password suite configuration\&.
189 .RE
190 .PP
191 /etc/passwd
192 .RS 4
193 Anv\(:andarkontoinformation\&.
194 .RE
195 .PP
196 /etc/shadow
197 .RS 4
198 S\(:aker anv\(:andarkontoinformation\&.
199 .RE
200 .SH "AVSLUTNINGSV\(:ARDEN"
201 .PP
202 Kommandot
203 \fBuserdel\fR
204 avslutas med f\(:oljande v\(:arden:
205 .PP
206 \fI0\fR
207 .RS 4
208 lyckad
209 .RE
210 .PP
211 \fI1\fR
212 .RS 4
213 kan inte uppdatera l\(:osenordsfilen
214 .RE
215 .PP
216 \fI2\fR
217 .RS 4
218 ogiltig kommandosyntax
219 .RE
220 .PP
221 \fI6\fR
222 .RS 4
223 angiven anv\(:andare finns inte
224 .RE
225 .PP
226 \fI8\fR
227 .RS 4
228 anv\(:andaren \(:ar f\(:or n\(:arvarande inloggad
229 .RE
230 .PP
231 \fI10\fR
232 .RS 4
233 kan inte uppdatera gruppfilen
234 .RE
235 .PP
236 \fI12\fR
237 .RS 4
238 kan inte ta bort hemkatalogen
239 .RE
240 .SH "T\(:ANK P\(oA"
241 .PP
242
243 \fBuserdel\fR
244 will not allow you to remove an account if there are running processes which belong to this account\&. In that case, you may have to kill those processes or lock the user\*(Aqs password or account and remove the account later\&. The
245 \fB\-f\fR
246 option can force the deletion of this account\&.
247 .PP
248 You should manually check all file systems to ensure that no files remain owned by this user\&.
249 .PP
250 Du f\(oar inte ta bort n\(oagra NIS\-attribut p\(oa en NIS\-klient\&. Detta m\(oaste genomf\(:oras p\(oa NIS\-servern\&.
251 .PP
252 If
253 \fBUSERGROUPS_ENAB\fR
254 is defined to
255 \fIyes\fR
256 in
257 /etc/login\&.defs,
258 \fBuserdel\fR
259 will delete the group with the same name as the user\&. To avoid inconsistencies in the passwd and group databases,
260 \fBuserdel\fR
261 will check that this group is not used as a primary group for another user, and will just warn without deleting the group otherwise\&. The
262 \fB\-f\fR
263 option can force the deletion of this group\&.
264 .SH "SE OCKS\(oA"
265 .PP
266 \fBchfn\fR(1),
267 \fBchsh\fR(1),
268 \fBpasswd\fR(1),
269 \fBlogin.defs\fR(5),
270 \fBgpasswd\fR(8),
271 \fBgroupadd\fR(8),
272 \fBgroupdel\fR(8),
273 \fBgroupmod\fR(8),
274 \fBuseradd\fR(8),
275 \fBusermod\fR(8)\&.