]>
Commit | Line | Data |
---|---|---|
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 | |
5 | login \- 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 | |
16 | is used when signing onto a system. It can also be used to switch from one | |
17 | user to another at any time (most modern shells have support for this | |
18 | feature built into them, however). | |
19 | ||
20 | If an argument is not given, | |
21 | .B login | |
22 | prompts for the username. | |
23 | ||
24 | If the user is | |
25 | .I not | |
26 | root, and if | |
27 | .I /etc/nologin | |
28 | exists, the contents of of this file are printed to the screen, and the | |
29 | login is terminated. This is typically used to prevent logins when the | |
30 | system is being taken down. | |
31 | ||
32 | If the user is root, then the login must be occuring on a tty listed in | |
33 | .IR /etc/securetty . | |
34 | Failures will be logged with the | |
35 | .B syslog | |
36 | facility. | |
37 | ||
38 | After these conditions are checked, the password will be requested and | |
39 | checks (if a password is required for this username). Ten attempts are | |
40 | allowed before | |
41 | .B login | |
42 | dies, but after the first three, the response starts to get very slow. | |
43 | Login failures are reported via the | |
44 | .B syslog | |
45 | facility. This facility is also used to report any successful root logins. | |
46 | ||
47 | If the file | |
48 | .I .hushlogin | |
49 | exists, then a "quiet" login is performed (this disables the checking of | |
50 | the checking of mail and the printing of the last login time and message of | |
51 | the day). Otherwise, if | |
52 | .I /var/adm/lastlog | |
53 | exists, the last login time is printed (and the current login is recorded). | |
54 | ||
55 | Random administrative things, such as setting the UID and GID of the tty | |
56 | are performed. The TERM environment variable is preserved, if it exists | |
57 | (other environment variables are preserved if the | |
58 | .B \-p | |
59 | option is used). Then the HOME, PATH, SHELL, TERM, MAIL, and LOGNAME | |
60 | environment variables are set. PATH defaults to | |
61 | .I /usr/local/bin:/bin:/usr/bin:. | |
62 | for normal users, and to | |
63 | .I /sbin:/bin:/usr/sbin:/usr/bin | |
64 | for root. Last, if this is not a "quiet" login, the message of the day is | |
65 | printed and the file with the user's name in | |
66 | .I /usr/spool/mail | |
67 | will be checked, and a message printed if it has non-zero length. | |
68 | ||
69 | The user's shell is then started. If no shell is specified for the user in | |
70 | .BR /etc/passwd , | |
71 | then | |
72 | .B /bin/sh | |
73 | is used. If there is no directory specified in | |
74 | .IR /etc/passwd , | |
75 | then | |
76 | .I / | |
77 | is used (the home directory is checked for the | |
78 | .I .hushlogin | |
79 | file described above). | |
80 | .SH OPTIONS | |
81 | .TP | |
82 | .B \-p | |
83 | Used by | |
84 | .BR getty (8) | |
85 | to tell | |
86 | .B login | |
87 | not to destroy the environment | |
88 | .TP | |
89 | .B \-f | |
90 | Used to skip a second login authentication. This specifically does | |
91 | .B not | |
92 | work for root, and does not appear to work well under Linux. | |
93 | .TP | |
94 | .B \-h | |
95 | Used by other servers (i.e., | |
96 | .BR telnetd (8)) | |
97 | to pass the name of the remote host to | |
98 | .B login | |
99 | so that it may be placed in utmp and wtmp. Only the superuser may use this | |
100 | option. | |
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 | |
120 | Linux, unlike other draconian operating systems, does not check quotas. | |
121 | ||
122 | The undocumented BSD | |
123 | .B \-r | |
124 | option is not supported. This may be required by some | |
125 | .BR rlogind (8) | |
126 | programs. | |
127 | .SH AUTHOR | |
128 | Derived from BSD login 5.40 (5/9/89) by Michael Glad (glad@daimi.dk) for HP-UX | |
129 | .br | |
130 | Ported to Linux 0.12: Peter Orbaek (poe@daimi.aau.dk) | |
131 |