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