]> git.ipfire.org Git - thirdparty/util-linux.git/blob - term-utils/agetty.8
Merge branch 'lscpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util...
[thirdparty/util-linux.git] / term-utils / agetty.8
1 .TH AGETTY 8 "May 2011" "util-linux" "System Administration"
2 .SH NAME
3 agetty \- alternative Linux getty
4
5 .SH SYNOPSIS
6 .BR "agetty " [\-8chiLmnsUw]
7 .RI "[\-a " user ]
8 .RI "[\-f " issue_file ]
9 .RI "[\-H " login_host ]
10 .RI "[\-I " init ]
11 .RI "[\-l " login_program ]
12 .RI "[\-t " timeout ]
13 .I port
14 .I baud_rate,...
15 .RI [ term ]
16
17 .SH DESCRIPTION
18 .ad
19 .fi
20 \fBagetty\fP opens a tty port, prompts for a login name and invokes
21 the /bin/login command. It is normally invoked by \fIinit(8)\fP.
22
23 \fBagetty\fP has several \fInon-standard\fP features that are useful
24 for hard-wired and for dial-in lines:
25 .IP o
26 Adapts the tty settings to parity bits and to erase, kill,
27 end-of-line and uppercase characters when it reads a login name.
28 The program can handle 7-bit characters with even, odd, none or space
29 parity, and 8-bit characters with no parity. The following special
30 characters are recognized: @ and Control-U (kill); #, DEL and
31 back space (erase); carriage return and line feed (end of line).
32 .IP o
33 Optionally deduces the baud rate from the CONNECT messages produced by
34 Hayes(tm)-compatible modems.
35 .IP o
36 Optionally does not hang up when it is given an already opened line
37 (useful for call-back applications).
38 .IP o
39 Optionally does not display the contents of the \fI/etc/issue\fP file.
40 .IP o
41 Optionally displays an alternative issue file instead of \fI/etc/issue\fP.
42 .IP o
43 Optionally does not ask for a login name.
44 .IP o
45 Optionally invokes a non-standard login program instead of
46 \fI/bin/login\fP.
47 .IP o
48 Optionally turns on hard-ware flow control
49 .IP o
50 Optionally forces the line to be local with no need for carrier detect.
51 .PP
52 This program does not use the \fI/etc/gettydefs\fP (System V) or
53 \fI/etc/gettytab\fP (SunOS 4) files.
54 .SH ARGUMENTS
55 .na
56 .nf
57 .fi
58 .ad
59 .TP
60 port
61 A path name relative to the \fI/dev\fP directory. If a "\-" is
62 specified, \fBagetty\fP assumes that its standard input is
63 already connected to a tty port and that a connection to a
64 remote user has already been established.
65 .sp
66 Under System V, a "\-" \fIport\fP argument should be preceded
67 by a "\-\-".
68 .TP
69 baud_rate,...
70 A comma-separated list of one or more baud rates. Each time
71 \fBagetty\fP receives a BREAK character it advances through
72 the list, which is treated as if it were circular.
73 .sp
74 Baud rates should be specified in descending order, so that the
75 null character (Ctrl\-@) can also be used for baud rate switching.
76 .TP
77 term
78 The value to be used for the TERM environment variable. This overrides
79 whatever init(8) may have set, and is inherited by login and the shell.
80 .SH OPTIONS
81 .na
82 .nf
83 .fi
84 .ad
85 .TP
86 \-8, \-\-8bits
87 Assume that the tty is 8-bit clean, hence disable parity detection.
88 .TP
89 \-a, \-\-autologin \fIusername\fP
90 Log the specified user automatically in without asking for a login name and
91 password. The \-f \fIusername\fP option is added to the \fB/bin/login\fP
92 command line by default. The \-\-login-options option changes this default
93 behaviour and then only \\u is replaced by the \fIusername\fP and no other
94 option is added to the login command line.
95 .TP
96 \-c, \-\-noreset
97 Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more
98 details.
99 .TP
100 \-f, \-\-issue\-file \fIissue_file\fP
101 Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
102 This allows custom messages to be displayed on different terminals.
103 The \-i option will override this option.
104 .TP
105 \-h, \-\-flow\-control
106 Enable hardware (RTS/CTS) flow control. It is left up to the
107 application to disable software (XON/XOFF) flow protocol where
108 appropriate.
109 .TP
110 \-H, \-\-host \fIlogin_host\fP
111 Write the specified \fIlogin_host\fP into the utmp file. (Normally,
112 no login host is given, since \fBagetty\fP is used for local hardwired
113 connections and consoles. However, this option can be useful for
114 identifying terminal concentrators and the like.
115 .TP
116 \-i, \-\-noissue
117 Do not display the contents of \fI/etc/issue\fP (or other) before writing the
118 login prompt. Terminals or communications hardware may become confused
119 when receiving lots of text at the wrong baud rate; dial-up scripts
120 may fail if the login prompt is preceded by too much text.
121 .TP
122 \-I, \-\-init\-string \fIinitstring\fP
123 Set an initial string to be sent to the tty or modem before sending
124 anything else. This may be used to initialize a modem. Non printable
125 characters may be sent by writing their octal code preceded by a
126 backslash (\\). For example to send a linefeed character (ASCII 10,
127 octal 012) write \\012.
128 .PP
129 .TP
130 \-l, \-\-login\-program \fIlogin_program\fP
131 Invoke the specified \fIlogin_program\fP instead of /bin/login.
132 This allows the use of a non-standard login program (for example,
133 one that asks for a dial-up password or that uses a different
134 password file).
135 .TP
136 \-L, \-\-local\-line
137 Force the line to be a local line with no need for carrier detect. This can
138 be useful when you have a locally attached terminal where the serial line
139 does not set the carrier detect signal.
140 .TP
141 \-m, \-\-extract\-baud
142 Try to extract the baud rate the CONNECT status message
143 produced by Hayes(tm)\-compatible modems. These status
144 messages are of the form: "<junk><speed><junk>".
145 \fBagetty\fP assumes that the modem emits its status message at
146 the same speed as specified with (the first) \fIbaud_rate\fP value
147 on the command line.
148 .sp
149 Since the \fI\-m\fP feature may fail on heavily-loaded systems,
150 you still should enable BREAK processing by enumerating all
151 expected baud rates on the command line.
152 .TP
153 \-n, \-\-skip\-login
154 Do not prompt the user for a login name. This can be used in
155 connection with \-l option to invoke a non-standard login process such
156 as a BBS system. Note that with the \-n option, \fBagetty\fR gets no input from
157 user who logs in and therefore won't be able to figure out parity,
158 character size, and newline processing of the connection. It defaults to
159 space parity, 7 bit characters, and ASCII CR (13) end-of-line character.
160 Beware that the program that \fBagetty\fR starts (usually /bin/login)
161 is run as root.
162 .TP
163 \-o, \-\-login\-options \fI"login_options"\fP
164 Options that are passed to the login program. \\u is replaced
165 by the login name. The default \fB/bin/login\fP command line
166 is "/bin/login -- <username>".
167
168 Please read the SECURITY NOTICE below if you want to use this.
169 .TP
170 \-p, \-\-login\-pause
171 Wait for any key before dropping to the login prompt. Can be combined
172 with \fB\-\-autologin\fP to save memory by lazily spawning shells.
173 .TP
174 \-R, \-\-hangup
175 Do call vhangup() for a virtually hangup of the specified terminal.
176 .TP
177 \-s, \-\-keep\-baud
178 Try to keep the existing baud rate. The baud rates from
179 the command line are used when agetty receives a BREAK character.
180 .TP
181 \-t, \-\-timeout \fItimeout\fP
182 Terminate if no user name could be read within \fItimeout\fP
183 seconds. This option should probably not be used with hard-wired
184 lines.
185 .TP
186 \-U, \-\-detect\-case
187 Turn on support for detecting an uppercase only terminal. This setting will
188 detect a login name containing only capitals as indicating an uppercase
189 only terminal and turn on some upper to lower case conversions. Note that
190 this has no support for any unicode characters.
191 .TP
192 \-w, \-\-wait\-cr
193 Wait for the user or the modem to send a carriage-return or a
194 linefeed character before sending the \fI/etc/issue\fP (or other) file
195 and the login prompt. Very useful in connection with the \-I option.
196 .TP
197 \-\-noclear
198 Do not clear the screen before prompting for the login name
199 (the screen is normally cleared).
200 .TP
201 \-\-nonewline
202 Do not print a newline before writing out /etc/issue.
203 .TP
204 \-\-nohostname
205 By default the hostname will be printed. With this option enabled,
206 no hostname at all will be shown.
207 .TP
208 \-\-long\-hostname
209 By default the hostname is only printed until the first dot. With
210 this option enabled, the full qualified hostname by gethostname()
211 or if not found by gethostbyname() is shown.
212 .TP
213 \-\-version
214 Output version information and exit.
215 .TP
216 \-\-help
217 Output help screen and exit.
218 .PP
219 .SH EXAMPLES
220 This section shows examples for the process field of an entry in the
221 \fI/etc/inittab\fP file. You'll have to prepend appropriate values
222 for the other fields. See \fIinittab(5)\fP for more details.
223
224 For a hard-wired line or a console tty:
225 .ti +5
226 /sbin/agetty 9600 ttyS1
227
228 For a directly connected terminal without proper carriage detect wiring:
229 (try this if your terminal just sleeps instead of giving you a password:
230 prompt.)
231 .ti +5
232 /sbin/agetty \-L 9600 ttyS1 vt100
233
234 For a old style dial-in line with a 9600/2400/1200 baud modem:
235 .ti +5
236 /sbin/agetty \-mt60 ttyS1 9600,2400,1200
237
238 For a Hayes modem with a fixed 115200 bps interface to the machine:
239 (the example init string turns off modem echo and result codes, makes
240 modem/computer DCD track modem/modem DCD, makes a DTR drop cause a
241 dis-connection and turn on auto-answer after 1 ring.)
242 .ti +5
243 /sbin/agetty \-w \-I 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
244
245 .SH SECURITY NOTICE
246 If you use the \fB\-\-login\-program\fP and \fB\-\-login\-options\fP options,
247 be aware that a malicious user may try to enter lognames with embedded options,
248 which then get passed to the used login program. Agetty does check
249 for a leading "\-" and makes sure the logname gets passed as one parameter
250 (so embedded spaces will not create yet another parameter), but depending
251 on how the login binary parses the command line that might not be sufficient.
252 Check that the used login program can not be abused this way.
253 .PP
254 Some programs use "\-\-" to indicate that the rest of the commandline should
255 not be interpreted as options. Use this feature if available by passing "\-\-"
256 before the username gets passed by \\u.
257
258 .SH ISSUE ESCAPES
259 The issue-file (\fI/etc/issue\fP or the file set with the \-f option)
260 may contain certain escape codes to display the system name, date and
261 time etc. All escape codes consist of a backslash (\\) immediately
262 followed by one of the letters explained below.
263
264 .TP
265 b
266 Insert the baudrate of the current line.
267 .TP
268 d
269 Insert the current date.
270 .TP
271 s
272 Insert the system name, the name of the operating system. Same as `uname \-s'.
273 .TP
274 l
275 Insert the name of the current tty line.
276 .TP
277 m
278 Insert the architecture identifier of the machine. Same as `uname \-m'.
279 .TP
280 n
281 Insert the nodename of the machine, also known as the hostname. Same as `uname \-n'.
282 .TP
283 o
284 Insert the NIS domainname of the machine. Same as `hostname \-d'.
285 .TP
286 O
287 Insert the DNS domainname of the machine.
288 .TP
289 r
290 Insert the release number of the OS. Same as `uname \-r'.
291 .TP
292 t
293 Insert the current time.
294 .TP
295 u
296 Insert the number of current users logged in.
297 .TP
298 U
299 Insert the string "1 user" or "<n> users" where <n> is the number of current
300 users logged in.
301 .TP
302 v
303 Insert the version of the OS, eg. the build-date etc.
304 .TP
305 Example: On my system, the following \fI/etc/issue\fP file:
306
307 .na
308 .nf
309 .ti +.5
310 This is \\n.\\o (\\s \\m \\r) \\t
311 .TP
312 displays as
313
314 .ti +.5
315 This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
316
317 .fi
318
319 .SH FILES
320 .na
321 .nf
322 /var/run/utmp, the system status file.
323 /etc/issue, printed before the login prompt.
324 /dev/console, problem reports (if syslog(3) is not used).
325 /etc/inittab, \fIinit\fP(8) configuration file.
326 .SH BUGS
327 .ad
328 .fi
329 The baud-rate detection feature (the \fI\-m\fP option) requires that
330 \fBagetty\fP be scheduled soon enough after completion of a dial-in
331 call (within 30 ms with modems that talk at 2400 baud). For robustness,
332 always use the \fI\-m\fP option in combination with a multiple baud
333 rate command-line argument, so that BREAK processing is enabled.
334
335 The text in the \fI/etc/issue\fP file (or other) and the login prompt
336 are always output with 7-bit characters and space parity.
337
338 The baud-rate detection feature (the \fI\-m\fP option) requires that
339 the modem emits its status message \fIafter\fP raising the DCD line.
340 .SH DIAGNOSTICS
341 .ad
342 .fi
343 Depending on how the program was configured, all diagnostics are
344 written to the console device or reported via the syslog(3) facility.
345 Error messages are produced if the \fIport\fP argument does not
346 specify a terminal device; if there is no utmp entry for the
347 current process (System V only); and so on.
348 .SH AUTHOR(S)
349 .na
350 .nf
351 W.Z. Venema <wietse@wzv.win.tue.nl>
352 Eindhoven University of Technology
353 Department of Mathematics and Computer Science
354 Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
355
356 Peter Orbaek <poe@daimi.aau.dk>
357 Linux port and more options. Still maintains the code.
358
359 Eric Rasmussen <ear@usfirst.org>
360 Added \-f option to display custom login messages on different terminals.
361
362 .SH AVAILABILITY
363 The agetty command is part of the util-linux package and is available from
364 ftp://ftp.kernel.org/pub/linux/utils/util\-linux/.