]> git.ipfire.org Git - thirdparty/util-linux.git/blame - login-utils/login.1
Imported from util-linux-2.2 tarball.
[thirdparty/util-linux.git] / login-utils / login.1
CommitLineData
6dbe3af9
KZ
1.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2.\" May be distributed under the GNU General Public License
3.TH LOGIN 1 "1 February 1993" "Linux 0.99" "Linux Programmer's Manual"
4.SH NAME
5login \- sign on
6.SH SYNOPSIS
7.BR "login [ " name " ]"
8.br
9.B "login \-p"
10.br
11.BR "login \-h " hostname
12.br
13.BR "login \-f " name
14.SH DESCRIPTION
15.B login
16is used when signing onto a system. It can also be used to switch from one
17user to another at any time (most modern shells have support for this
18feature built into them, however).
19
20If an argument is not given,
21.B login
22prompts for the username.
23
24If the user is
25.I not
26root, and if
27.I /etc/nologin
28exists, the contents of of this file are printed to the screen, and the
29login is terminated. This is typically used to prevent logins when the
30system is being taken down.
31
32If the user is root, then the login must be occuring on a tty listed in
33.IR /etc/securetty .
34Failures will be logged with the
35.B syslog
36facility.
37
38After these conditions are checked, the password will be requested and
39checks (if a password is required for this username). Ten attempts are
40allowed before
41.B login
42dies, but after the first three, the response starts to get very slow.
43Login failures are reported via the
44.B syslog
45facility. This facility is also used to report any successful root logins.
46
47If the file
48.I .hushlogin
49exists, then a "quiet" login is performed (this disables the checking of
50the checking of mail and the printing of the last login time and message of
51the day). Otherwise, if
52.I /var/adm/lastlog
53exists, the last login time is printed (and the current login is recorded).
54
55Random administrative things, such as setting the UID and GID of the tty
56are performed. The TERM environment variable is preserved, if it exists
57(other environment variables are preserved if the
58.B \-p
59option is used). Then the HOME, PATH, SHELL, TERM, MAIL, and LOGNAME
60environment variables are set. PATH defaults to
61.I /usr/local/bin:/bin:/usr/bin:.
62for normal users, and to
63.I /sbin:/bin:/usr/sbin:/usr/bin
64for root. Last, if this is not a "quiet" login, the message of the day is
65printed and the file with the user's name in
66.I /usr/spool/mail
67will be checked, and a message printed if it has non-zero length.
68
69The user's shell is then started. If no shell is specified for the user in
70.BR /etc/passwd ,
71then
72.B /bin/sh
73is used. If there is no directory specified in
74.IR /etc/passwd ,
75then
76.I /
77is used (the home directory is checked for the
78.I .hushlogin
79file described above).
80.SH OPTIONS
81.TP
82.B \-p
83Used by
84.BR getty (8)
85to tell
86.B login
87not to destroy the environment
88.TP
89.B \-f
90Used to skip a second login authentication. This specifically does
91.B not
92work for root, and does not appear to work well under Linux.
93.TP
94.B \-h
95Used by other servers (i.e.,
96.BR telnetd (8))
97to pass the name of the remote host to
98.B login
99so that it may be placed in utmp and wtmp. Only the superuser may use this
100option.
101.SH FILES
102.nf
103.I /etc/utmp
104.I /etc/wtmp
105.I /usr/spool/mail/*
106.I /etc/motd
107.I /etc/passwd
108.I /etc/nologin
109.I .hushlogin
110.fi
111.SH "SEE ALSO"
112.BR init (8),
113.BR getty (8),
114.BR mail (1),
115.BR passwd (1),
116.BR passwd (5),
117.BR environ (7),
118.BR shutdown (8)
119.SH BUGS
120Linux, unlike other draconian operating systems, does not check quotas.
121
122The undocumented BSD
123.B \-r
124option is not supported. This may be required by some
125.BR rlogind (8)
126programs.
127.SH AUTHOR
128Derived from BSD login 5.40 (5/9/89) by Michael Glad (glad@daimi.dk) for HP-UX
129.br
130Ported to Linux 0.12: Peter Orbaek (poe@daimi.aau.dk)
131