1 .TH AGETTY 8 "May 2011" "util-linux" "System Administration"
3 agetty \- alternative Linux getty
15 \fBagetty\fP opens a tty port, prompts for a login name and invokes
16 the /bin/login command. It is normally invoked by \fIinit(8)\fP.
18 \fBagetty\fP has several \fInon-standard\fP features that are useful
19 for hard-wired and for dial-in lines:
21 Adapts the tty settings to parity bits and to erase, kill,
22 end-of-line and uppercase characters when it reads a login name.
23 The program can handle 7-bit characters with even, odd, none or space
24 parity, and 8-bit characters with no parity. The following special
25 characters are recognized: Control-U (kill); DEL and
26 back space (erase); carriage return and line feed (end of line).
27 See also \fB\-\-erase-chars\fP and \fB\-\-kill-chars\fP options.
29 Optionally deduces the baud rate from the CONNECT messages produced by
30 Hayes(tm)-compatible modems.
32 Optionally does not hang up when it is given an already opened line
33 (useful for call-back applications).
35 Optionally does not display the contents of the \fI/etc/issue\fP file.
37 Optionally displays an alternative issue file instead of \fI/etc/issue\fP.
39 Optionally does not ask for a login name.
41 Optionally invokes a non-standard login program instead of
44 Optionally turns on hard-ware flow control
46 Optionally forces the line to be local with no need for carrier detect.
48 This program does not use the \fI/etc/gettydefs\fP (System V) or
49 \fI/etc/gettytab\fP (SunOS 4) files.
57 A path name relative to the \fI/dev\fP directory. If a "\-" is
58 specified, \fBagetty\fP assumes that its standard input is
59 already connected to a tty port and that a connection to a
60 remote user has already been established.
62 Under System V, a "\-" \fIport\fP argument should be preceded
66 A comma-separated list of one or more baud rates. Each time
67 \fBagetty\fP receives a BREAK character it advances through
68 the list, which is treated as if it were circular.
70 Baud rates should be specified in descending order, so that the
71 null character (Ctrl\-@) can also be used for baud rate switching.
73 This argument is optional and unnecessary for virtual terminals.
74 The default for serial terminals is '9600'.
77 The value to be used for the TERM environment variable. This overrides
78 whatever init(8) may have set, and is inherited by login and the shell.
80 The default is 'vt100', or 'linux' for Linux on virtual terminal, or 'hurd'
81 for GNU Hurd on virtual terminal.
89 Assume that the tty is 8-bit clean, hence disable parity detection.
91 \-a, \-\-autologin \fIusername\fP
92 Log the specified user automatically in without asking for a login name and
93 password. The \-f \fIusername\fP option is added to the \fB/bin/login\fP
94 command line by default. The \-\-login-options option changes this default
95 behaviour and then only \\u is replaced by the \fIusername\fP and no other
96 option is added to the login command line.
99 Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more
103 If \-H \fIfakehost\fP option is given then \-r \fIfakehost\fP options is
104 added to the \fB/bin/login\fP command line.
106 \-f, \-\-issue\-file \fIissue_file\fP
107 Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
108 This allows custom messages to be displayed on different terminals.
109 The \-i option will override this option.
111 \-h, \-\-flow\-control
112 Enable hardware (RTS/CTS) flow control. It is left up to the
113 application to disable software (XON/XOFF) flow protocol where
116 \-H, \-\-host \fIlogin_host\fP
117 Write the specified \fIlogin_host\fP into the utmp file. (Normally,
118 no login host is given, since \fBagetty\fP is used for local hardwired
119 connections and consoles. However, this option can be useful for
120 identifying terminal concentrators and the like.
123 Do not display the contents of \fI/etc/issue\fP (or other) before writing the
124 login prompt. Terminals or communications hardware may become confused
125 when receiving lots of text at the wrong baud rate; dial-up scripts
126 may fail if the login prompt is preceded by too much text.
128 \-I, \-\-init\-string \fIinitstring\fP
129 Set an initial string to be sent to the tty or modem before sending
130 anything else. This may be used to initialize a modem. Non printable
131 characters may be sent by writing their octal code preceded by a
132 backslash (\\). For example to send a linefeed character (ASCII 10,
133 octal 012) write \\012.
136 \-l, \-\-login\-program \fIlogin_program\fP
137 Invoke the specified \fIlogin_program\fP instead of /bin/login.
138 This allows the use of a non-standard login program (for example,
139 one that asks for a dial-up password or that uses a different
142 \-L, \-\-local\-line [=\fImode\fP]
143 Control CLOCAL line flag, the optional argument \fImode\fP is 'auto', 'always' or 'never'.
144 If the \fImode\fP argument is omitted then the default is 'always'. If the
145 \-\-local\-line option is ommitted at all then the default is 'auto'.
147 The \fImode\fP 'always' forces the line to be a local line with no need for carrier detect. This can
148 be useful when you have a locally attached terminal where the serial line
149 does not set the carrier detect signal.
151 The \fImode\fP 'never' explicitly clears CLOCAL flags from line setting and
152 the carrier detect signal is expected on the line.
154 The \fImode\fP 'auto' (agetty default) does not modify CLOCAL setting
155 and follows the setting enabled by kernel.
157 \-m, \-\-extract\-baud
158 Try to extract the baud rate the CONNECT status message
159 produced by Hayes(tm)\-compatible modems. These status
160 messages are of the form: "<junk><speed><junk>".
161 \fBagetty\fP assumes that the modem emits its status message at
162 the same speed as specified with (the first) \fIbaud_rate\fP value
165 Since the \fI\-m\fP feature may fail on heavily-loaded systems,
166 you still should enable BREAK processing by enumerating all
167 expected baud rates on the command line.
170 Do not prompt the user for a login name. This can be used in
171 connection with \-l option to invoke a non-standard login process such
172 as a BBS system. Note that with the \-n option, \fBagetty\fR gets no input from
173 user who logs in and therefore won't be able to figure out parity,
174 character size, and newline processing of the connection. It defaults to
175 space parity, 7 bit characters, and ASCII CR (13) end-of-line character.
176 Beware that the program that \fBagetty\fR starts (usually /bin/login)
179 \-o, \-\-login\-options \fI"login_options"\fP
180 Options that are passed to the login program. \\u is replaced
181 by the login name. The default \fB/bin/login\fP command line
182 is "/bin/login -- <username>".
184 Please read the SECURITY NOTICE below if you want to use this.
186 \-p, \-\-login\-pause
187 Wait for any key before dropping to the login prompt. Can be combined
188 with \fB\-\-autologin\fP to save memory by lazily spawning shells.
190 \-r, \-\-chroot \fI"directory"\fP
191 Change root to the specified directory.
194 Do call vhangup() for a virtually hangup of the specified terminal.
197 Try to keep the existing baud rate. The baud rates from
198 the command line are used when agetty receives a BREAK character.
200 \-t, \-\-timeout \fItimeout\fP
201 Terminate if no user name could be read within \fItimeout\fP
202 seconds. This option should probably not be used with hard-wired
205 \-U, \-\-detect\-case
206 Turn on support for detecting an uppercase only terminal. This setting will
207 detect a login name containing only capitals as indicating an uppercase
208 only terminal and turn on some upper to lower case conversions. Note that
209 this has no support for any unicode characters.
212 Wait for the user or the modem to send a carriage-return or a
213 linefeed character before sending the \fI/etc/issue\fP (or other) file
214 and the login prompt. Very useful in connection with the \-I option.
217 Do not clear the screen before prompting for the login name
218 (the screen is normally cleared).
221 Do not print hints about Num, Caps and Scroll Locks.
224 Do not print a newline before writing out /etc/issue.
227 By default the hostname will be printed. With this option enabled,
228 no hostname at all will be shown.
231 By default the hostname is only printed until the first dot. With
232 this option enabled, the full qualified hostname by gethostname()
233 or if not found by getaddrinfo() is shown.
235 \-\-erase\-chars \fIstring\fP
236 This option specifies additional chars that should be interpreted as a
237 backspace (ignore previous char) when user specifies login name. The original
238 default has been \'#\', since util-linux 2.23 no additional erase chars are
241 \-\-kill\-chars \fIstring\fP
242 This option specifies additional chars that should be interpreted as a
243 kill (ignore all previous chars) when user specifies login name. The original
244 default has been \'@\', since util-linux 2.23 no additional erase chars are
248 Output version information and exit.
251 Output help screen and exit.
254 This section shows examples for the process field of an entry in the
255 \fI/etc/inittab\fP file. You'll have to prepend appropriate values
256 for the other fields. See \fIinittab(5)\fP for more details.
258 For a hard-wired line or a console tty:
261 /sbin/agetty 9600 ttyS1
264 For a directly connected terminal without proper carriage detect wiring:
265 (try this if your terminal just sleeps instead of giving you a password:
269 /sbin/agetty \-L 9600 ttyS1 vt100
272 For a old style dial-in line with a 9600/2400/1200 baud modem:
275 /sbin/agetty \-mt60 ttyS1 9600,2400,1200
278 For a Hayes modem with a fixed 115200 bps interface to the machine:
279 (the example init string turns off modem echo and result codes, makes
280 modem/computer DCD track modem/modem DCD, makes a DTR drop cause a
281 dis-connection and turn on auto-answer after 1 ring.)
284 /sbin/agetty \-w \-I 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
288 If you use the \fB\-\-login\-program\fP and \fB\-\-login\-options\fP options,
289 be aware that a malicious user may try to enter lognames with embedded options,
290 which then get passed to the used login program. Agetty does check
291 for a leading "\-" and makes sure the logname gets passed as one parameter
292 (so embedded spaces will not create yet another parameter), but depending
293 on how the login binary parses the command line that might not be sufficient.
294 Check that the used login program can not be abused this way.
296 Some programs use "\-\-" to indicate that the rest of the commandline should
297 not be interpreted as options. Use this feature if available by passing "\-\-"
298 before the username gets passed by \\u.
301 The issue-file (\fI/etc/issue\fP or the file set with the \-f option)
302 may contain certain escape codes to display the system name, date and
303 time etc. All escape codes consist of a backslash (\\) immediately
304 followed by one of the letters explained below.
308 Insert the IPv4 address of the machine hostname or IPv4 address the configured
309 network interface if the interface argument is specified (e.g. \\4{eth0}).
312 Insert the IPv6 address of the machine hostname or IPv6 address the configured
313 network interface if the interface argument is specified (e.g. \\6{eth0}}
316 Insert the baudrate of the current line.
319 Insert the current date.
322 Insert the system name, the name of the operating system. Same as `uname \-s'.
325 Insert the name of the current tty line.
328 Insert the architecture identifier of the machine. Same as `uname \-m'.
331 Insert the nodename of the machine, also known as the hostname. Same as `uname \-n'.
334 Insert the NIS domainname of the machine. Same as `hostname \-d'.
337 Insert the DNS domainname of the machine.
340 Insert the release number of the OS. Same as `uname \-r'.
343 Insert the current time.
346 Insert the number of current users logged in.
349 Insert the string "1 user" or "<n> users" where <n> is the number of current
353 Insert the version of the OS, eg. the build-date etc.
355 Example: On my system, the following \fI/etc/issue\fP file:
360 This is \\n.\\o (\\s \\m \\r) \\t
368 This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
376 the system status file.
379 printed before the login prompt.
382 problem reports (if syslog(3) is not used).
385 \fIinit\fP(8) configuration file.
389 The baud-rate detection feature (the \fI\-m\fP option) requires that
390 \fBagetty\fP be scheduled soon enough after completion of a dial-in
391 call (within 30 ms with modems that talk at 2400 baud). For robustness,
392 always use the \fI\-m\fP option in combination with a multiple baud
393 rate command-line argument, so that BREAK processing is enabled.
395 The text in the \fI/etc/issue\fP file (or other) and the login prompt
396 are always output with 7-bit characters and space parity.
398 The baud-rate detection feature (the \fI\-m\fP option) requires that
399 the modem emits its status message \fIafter\fP raising the DCD line.
403 Depending on how the program was configured, all diagnostics are
404 written to the console device or reported via the syslog(3) facility.
405 Error messages are produced if the \fIport\fP argument does not
406 specify a terminal device; if there is no utmp entry for the
407 current process (System V only); and so on.
419 for serial terminals was written by W.Z. Venema <wietse@wzv.win.tue.nl>
420 and ported to Linux by Peter Orbaek <poe@daimi.aau.dk>.
423 The agetty command is part of the util-linux package and is available from
424 ftp://ftp.kernel.org/pub/linux/utils/util\-linux/.