OSDN Git Service

util-linux 2.37.3: Reserve to translate.
[linuxjm/jm.git] / manual / util-linux / original / man1 / login.1
1 '\" t
2 .\"     Title: login
3 .\"    Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.15
5 .\"      Date: 2022-01-24
6 .\"    Manual: User Commands
7 .\"    Source: util-linux 2.37.3
8 .\"  Language: English
9 .\"
10 .TH "LOGIN" "1" "2022-01-24" "util\-linux 2.37.3" "User Commands"
11 .ie \n(.g .ds Aq \(aq
12 .el       .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 .  mso www.tmac
22 .  am URL
23 .    ad l
24 .  .
25 .  am MTO
26 .    ad l
27 .  .
28 .  LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 login \- begin session on the system
32 .SH "SYNOPSIS"
33 .sp
34 \fBlogin\fP [\fB\-p\fP] [\fB\-h\fP \fIhost\fP] [\fB\-H\fP] [\fB\-f\fP \fIusername\fP|\fIusername\fP]
35 .SH "DESCRIPTION"
36 .sp
37 \fBlogin\fP is used when signing onto a system. If no argument is given, \fBlogin\fP prompts for the username.
38 .sp
39 The user is then prompted for a password, where appropriate. Echoing is disabled to prevent revealing the password. Only a number of password failures are permitted before \fBlogin\fP exits and the communications link is severed. See \fBLOGIN_RETRIES\fP in CONFIG FILE ITEMS section.
40 .sp
41 If password aging has been enabled for the account, the user may be prompted for a new password before proceeding. In such case old password must be provided and the new password entered before continuing. Please refer to \fBpasswd\fP(1) for more information.
42 .sp
43 The user and group ID will be set according to their values in the \fI/etc/passwd\fP file. There is one exception if the user ID is zero. In this case, only the primary group ID of the account is set. This should allow the system administrator to login even in case of network problems. The environment variable values for \fB$HOME\fP, \fB$USER\fP, \fB$SHELL\fP, \fB$PATH\fP, \fB$LOGNAME\fP, and \fB$MAIL\fP are set according to the appropriate fields in the password entry. \fB$PATH\fP defaults to \fI/usr/local/bin:/bin:/usr/bin\fP for normal users, and to \fI/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\fP for root, if not otherwise configured.
44 .sp
45 The environment variable \fB$TERM\fP will be preserved, if it exists, else it will be initialized to the terminal type on your tty. Other environment variables are preserved if the \fB\-p\fP option is given.
46 .sp
47 Then the user\(cqs shell is started. If no shell is specified for the user in \fI/etc/passwd\fP, then \fI/bin/sh\fP is used. If there is no home directory specified in \fI/etc/passwd\fP, then \fI/\fP is used, followed by \fI.hushlogin\fP check as described below.
48 .sp
49 If the file \fI.hushlogin\fP exists, then a "quiet" login is performed. This disables the checking of mail and the printing of the last login time and message of the day. Otherwise, if \fI/var/log/lastlog\fP exists, the last login time is printed, and the current login is recorded.
50 .SH "OPTIONS"
51 .sp
52 \fB\-p\fP
53 .RS 4
54 Used by \fBgetty\fP(8) to tell \fBlogin\fP to preserve the environment.
55 .RE
56 .sp
57 \fB\-f\fP
58 .RS 4
59 Used to skip a login authentication. This option is usually used by the \fBgetty\fP(8) autologin feature.
60 .RE
61 .sp
62 \fB\-h\fP
63 .RS 4
64 Used by other servers (such as \fBtelnetd\fP(8) to pass the name of the remote host to \fBlogin\fP so that it can be placed in utmp and wtmp. Only the superuser is allowed use this option.
65 .sp
66 Note that the \fB\-h\fP option has an impact on the \fBPAM service\fP \fBname\fP. The standard service name is \fIlogin\fP, but with the \fB\-h\fP option, the name is \fIremote\fP. It is necessary to create proper PAM config files (for example, \fI/etc/pam.d/login\fP and \fI/etc/pam.d/remote\fP).
67 .RE
68 .sp
69 \fB\-H\fP
70 .RS 4
71 Used by other servers (for example, \fBtelnetd\fP(8)) to tell \fBlogin\fP that printing the hostname should be suppressed in the login: prompt. See also \fBLOGIN_PLAIN_PROMPT\fP below.
72 .RE
73 .sp
74 \fB\-\-help\fP
75 .RS 4
76 Display help text and exit.
77 .RE
78 .sp
79 \fB\-V\fP, \fB\-\-version\fP
80 .RS 4
81 Display version information and exit.
82 .RE
83 .SH "CONFIG FILE ITEMS"
84 .sp
85 \fBlogin\fP reads the \fI/etc/login.defs\fP configuration file (see login.defs(5)). Note that the configuration file could be distributed with another package (usually shadow\-utils). The following configuration items are relevant for \fBlogin\fP:
86 .sp
87 \fBMOTD_FILE\fP (string)
88 .RS 4
89 Specifies a ":" delimited list of "message of the day" files and directories to be displayed upon login. If the specified path is a directory then displays all files with .motd file extension in version\-sort order from the directory.
90 .sp
91 The default value is \fI/usr/share/misc/motd:/run/motd:/etc/motd\fP. If the \fBMOTD_FILE\fP item is empty or a quiet login is enabled, then the message of the day is not displayed. Note that the same functionality is also provided by the \fBpam_motd\fP(8) PAM module.
92 .sp
93 The directories in the \fBMOTD_FILE\fP are supported since version 2.36.
94 .sp
95 Note that \fBlogin\fP does not implement any filenames overriding behavior like pam_motd (see also \fBMOTD_FIRSTONLY\fP), but all content from all files is displayed. It is recommended to keep extra logic in content generators and use \fI/run/motd.d\fP rather than rely on overriding behavior hardcoded in system tools.
96 .RE
97 .sp
98 \fBMOTD_FIRSTONLY\fP (boolean)
99 .RS 4
100 Forces \fBlogin\fP to stop display content specified by \fBMOTD_FILE\fP after the first accessible item in the list. Note that a directory is one item in this case. This option allows \fBlogin\fP semantics to be configured to be more compatible with pam_motd. The default value is \fIno\fP.
101 .RE
102 .sp
103 \fBLOGIN_PLAIN_PROMPT\fP (boolean)
104 .RS 4
105 Tell \fBlogin\fP that printing the hostname should be suppressed in the login: prompt. This is an alternative to the \fB\-H\fP command line option. The default value is \fIno\fP.
106 .RE
107 .sp
108 \fBLOGIN_TIMEOUT\fP (number)
109 .RS 4
110 Maximum time in seconds for login. The default value is \fI60\fP.
111 .RE
112 .sp
113 \fBLOGIN_RETRIES\fP (number)
114 .RS 4
115 Maximum number of login retries in case of a bad password. The default value is \fI3\fP.
116 .RE
117 .sp
118 \fBLOGIN_KEEP_USERNAME\fP (boolean)
119 .RS 4
120 Tell \fBlogin\fP to only re\-prompt for the password if authentication failed, but the username is valid. The default value is \fIno\fP.
121 .RE
122 .sp
123 \fBFAIL_DELAY\fP (number)
124 .RS 4
125 Delay in seconds before being allowed another three tries after a login failure. The default value is \fI5\fP.
126 .RE
127 .sp
128 \fBTTYPERM\fP (string)
129 .RS 4
130 The terminal permissions. The default value is \fI0600\fP or \fI0620\fP if tty group is used.
131 .RE
132 .sp
133 \fBTTYGROUP\fP (string)
134 .RS 4
135 The login tty will be owned by the \fBTTYGROUP\fP. The default value is \fItty\fP. If the \fBTTYGROUP\fP does not exist, then the ownership of the terminal is set to the user\(cqs primary group.
136 .sp
137 The \fBTTYGROUP\fP can be either the name of a group or a numeric group identifier.
138 .RE
139 .sp
140 \fBHUSHLOGIN_FILE\fP (string)
141 .RS 4
142 If defined, this file can inhibit all the usual chatter during the login sequence. If a full pathname (for example, \fI/etc/hushlogins\fP) is specified, then hushed mode will be enabled if the user\(cqs name or shell are found in the file. If this global hush login file is empty then the hushed mode will be enabled for all users.
143 .sp
144 If a full pathname is not specified, then hushed mode will be enabled if the file exists in the user\(cqs home directory.
145 .sp
146 The default is to check \fI/etc/hushlogins\fP and if it does not exist then \fI~/.hushlogin\fP.
147 .sp
148 If the \fBHUSHLOGIN_FILE\fP item is empty, then all the checks are disabled.
149 .RE
150 .sp
151 \fBDEFAULT_HOME\fP (boolean)
152 .RS 4
153 Indicate if login is allowed if we cannot change directory to the home directory. If set to \fIyes\fP, the user will login in the root (/) directory if it is not possible to change directory to their home. The default value is \fIyes\fP.
154 .RE
155 .sp
156 \fBLASTLOG_UID_MAX\fP (unsigned number)
157 .RS 4
158 Highest user ID number for which the \fIlastlog\fP entries should be updated. As higher user IDs are usually tracked by remote user identity and authentication services there is no need to create a huge sparse \fIlastlog\fP file for them. No LASTLOG_UID_MAX option present in the configuration means that there is no user ID limit for writing \fIlastlog\fP entries. The default value is \fIULONG_MAX\fP.
159 .RE
160 .sp
161 \fBLOG_UNKFAIL_ENAB\fP (boolean)
162 .RS 4
163 Enable display of unknown usernames when login failures are recorded. The default value is \fIno\fP.
164 .sp
165 Note that logging unknown usernames may be a security issue if a user enters their password instead of their login name.
166 .RE
167 .sp
168 \fBENV_PATH\fP (string)
169 .RS 4
170 If set, it will be used to define the \fBPATH\fP environment variable when a regular user logs in. The default value is \fI/usr/local/bin:/bin:/usr/bin\fP.
171 .RE
172 .sp
173 \fBENV_ROOTPATH\fP (string), \fBENV_SUPATH\fP (string)
174 .RS 4
175 If set, it will be used to define the PATH environment variable when the superuser logs in. \fBENV_ROOTPATH\fP takes precedence. The default value is \fI/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\fP.
176 .RE
177 .SH "FILES"
178 .sp
179 \fI/var/run/utmp\fP,
180 \fI/var/log/wtmp\fP,
181 \fI/var/log/lastlog\fP,
182 \fI/var/spool/mail/*\fP,
183 \fI/etc/motd\fP,
184 \fI/etc/passwd\fP,
185 \fI/etc/nologin\fP,
186 \fI/etc/pam.d/login\fP,
187 \fI/etc/pam.d/remote\fP,
188 \fI/etc/hushlogins\fP,
189 \fI$HOME/.hushlogin\fP
190 .SH "BUGS"
191 .sp
192 The undocumented BSD \fB\-r\fP option is not supported. This may be required by some \fBrlogind\fP(8) programs.
193 .sp
194 A recursive login, as used to be possible in the good old days, no longer works; for most purposes \fBsu\fP(1) is a satisfactory substitute. Indeed, for security reasons, \fBlogin\fP does a \fBvhangup\fP(2) system call to remove any possible listening processes on the tty. This is to avoid password sniffing. If one uses the command \fBlogin\fP, then the surrounding shell gets killed by \fBvhangup\fP(2) because it\(cqs no longer the true owner of the tty. This can be avoided by using \fBexec login\fP in a top\-level shell or xterm.
195 .SH "AUTHORS"
196 .sp
197 Derived from BSD login 5.40 (5/9/89) by \c
198 .MTO "glad\(atdaimi.dk" "Michael Glad" ""
199 for HP\-UX. Ported to Linux 0.12:
200 .MTO "poe\(atdaimi.aau.dk" "Peter Orbaek" "."
201 Rewritten to a PAM\-only version by
202 .MTO "kzak\(atredhat.com" "Karel Zak" ""
203 .SH "SEE ALSO"
204 .sp
205 \fBmail\fP(1),
206 \fBpasswd\fP(1),
207 \fBpasswd\fP(5),
208 \fButmp\fP(5),
209 \fBenviron\fP(7),
210 \fBgetty\fP(8),
211 \fBinit\fP(8),
212 \fBlastlog\fP(8),
213 \fBshutdown\fP(8)
214 .SH "REPORTING BUGS"
215 .sp
216 For bug reports, use the issue tracker at \c
217 .URL "https://github.com/karelzak/util\-linux/issues" "" "."
218 .SH "AVAILABILITY"
219 .sp
220 The \fBlogin\fP command is part of the util\-linux package which can be downloaded from \c
221 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."