1 .\" $Heimdal: login.1 14891 2005-04-22 15:49:25Z joda $
10 authenticate a user and start new session
18 This manual page documents the
20 program distributed with the Heimdal Kerberos 5 implementation, it may
21 differ in important ways from your system version.
25 programs logs users into the system. It is intended to be run by
30 If you are already logged in, but want to change to another user, you
34 A username can be given on the command line, else one will be prompted
37 A password is required to login, unless the
39 option is given (indicating that the calling program has already done
40 proper authentication). With
42 the user will be logged in without further questions.
44 For password authentication Kerberos 5, Kerberos 4 (if compiled in),
45 OTP (if compiled in) and local
46 .No ( Pa /etc/passwd )
47 passwords are supported. OTP will be used if the the user is
48 registered to use it, and
52 When using OTP, a challenge is shown to the user.
57 Which authentication mode to use, the only supported value is
61 Indicates that the user is already authenticated. This happens, for
62 instance, when login is started by telnetd, and the user has proved
63 authentic via Kerberos.
65 Indicates which host the user is logging in from. This is passed from
66 telnetd, and is entered into the login database.
70 to preserve all environment variables. If not given, only the
74 variables are preserved. It could be a security risk to pass random
77 or the user shell, so the calling daemon should make sure it only
83 The process of logging user in proceeds as follows.
85 First a check is made that logins are allowed at all. This usually
88 If it exists, and the user trying to login is not root, the contents
89 is printed, and then login exits.
91 Then various system parameters are set up, like changing the owner of
92 the tty to the user, setting up signals, setting the group list, and
93 user and group id. Also various machine specific tasks are performed.
97 changes to the users home directory, or if that fails, to
99 The environment is setup, by adding some required variables (such as
101 and also authentication related ones (such as
103 If an environment file exists
104 .No ( Pa /etc/environment ) ,
105 variables are set according to
108 If one or more login message files are configured, their contents is
109 printed to the terminal.
111 If a login time command is configured, it is executed. A logout time
112 command can also be configured, which makes
114 fork, and wait for the user shell to exit, and then run the command.
115 This can be used to clean up user credentials.
117 Finally, the user's shell is executed. If the user logging in is root,
118 and root's login shell does not exist, a default shell (usually
120 is also tried before giving up.
122 These environment variables are set by login (not including ones set by
123 .Pa /etc/environment ) :
125 .Bl -tag -compact -width USERXXLOGNAME
127 the default system path
129 the user's home directory (or possibly
131 .It Dv USER , Dv LOGNAME
132 both set to the username
136 set to whatever is passed to
139 if the password is verified via Kerberos 5, this will point to the
140 credentials cache file
142 if the password is verified via Kerberos 4, this will point to the
146 .Bl -tag -compact -width Ds
147 .It Pa /etc/environment
148 Contains a set of environment variables that should be set in addition
149 to the ones above. It should contain sh-style assignments like
151 Note that they are not parsed the way a shell would. No variable
152 expansion is performed, and all strings are literal, and quotation
153 marks should not be used. Everything after a hash mark is considered a
154 comment. The following are all different (the last will set the
159 .Bd -literal -offset indent
161 FOO="this is a string"
162 BAR= FOO='this is a string'
164 .It Pa /etc/login.access
167 .It Pa /etc/login.conf
168 This is a termcap style configuration file, that contains various
173 capability record is used. The possible capability strings include:
175 .Bl -tag -compact -width Ds
177 This is a comma separated list of environment files that are read in
178 the order specified. If this is missing the default
182 This program will be executed just before the user's shell is started.
183 It will be called without arguments.
184 .It Li logout_program
185 This program will be executed just after the user's shell has
186 terminated. It will be called without arguments. This program will be
187 the parent process of the spawned shell.
189 A comma separated list of text files that will be printed to the
190 user's terminal before starting the shell. The string
192 works similarly, but points to a single file.
194 Points to a file containing ulimit settings for various users. Syntax
195 is inspired by what pam_limits uses, and the default is
196 .Pa /etc/security/limits.conf .
199 If it exists, login is denied to all but root. The contents of this
200 file is printed before login exits.
205 programs typically print all sorts of information by default, such as
206 last time you logged in, if you have mail, and system message files.
209 does not, so there is no reason for
211 files or similar. We feel that these tasks are best left to the user's
214 facility allows for a shell independent solution, if that is desired.
218 file could look like:
219 .Bd -literal -offset indent
221 :motd=/etc/motd,/etc/motd.local:\\
222 :limits=/etc/limits.conf:
227 file consists of a table with four whitespace separated fields. First
228 field is a username or a groupname (prefixed with
237 (the last meaning both soft and hard).
238 Third field is a limit name (such as
242 Last field is the limit value (a number or
244 for unlimited). In the case of data sizes, the value is in kilobytes,
245 and cputime is in minutes.
252 This login program was written for the Heimdal Kerberos 5
253 implementation. The login.access code was written by Wietse Venema.