1
.TH AGETTY 8 "May 2011" "util-linux" "System Administration"
3
agetty \- alternative Linux getty
6
.BR "agetty " [\-8chiLmnsUw]
8
.RI "[\-f " issue_file ]
9
.RI "[\-H " login_host ]
11
.RI "[\-l " login_program ]
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.
23
\fBagetty\fP has several \fInon-standard\fP features that are useful
24
for hard-wired and for dial-in lines:
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).
33
Optionally deduces the baud rate from the CONNECT messages produced by
34
Hayes(tm)-compatible modems.
36
Optionally does not hang up when it is given an already opened line
37
(useful for call-back applications).
39
Optionally does not display the contents of the \fI/etc/issue\fP file.
41
Optionally displays an alternative issue file instead of \fI/etc/issue\fP.
43
Optionally does not ask for a login name.
45
Optionally invokes a non-standard login program instead of
48
Optionally turns on hard-ware flow control
50
Optionally forces the line to be local with no need for carrier detect.
52
This program does not use the \fI/etc/gettydefs\fP (System V) or
53
\fI/etc/gettytab\fP (SunOS 4) files.
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.
66
Under System V, a "\-" \fIport\fP argument should be preceded
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.
74
Baud rates should be specified in descending order, so that the
75
null character (Ctrl\-@) can also be used for baud rate switching.
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.
87
Assume that the tty is 8-bit clean, hence disable parity detection.
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.
97
Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more
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.
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
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.
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.
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.
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
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.
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
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.
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)
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>".
168
Please read the SECURITY NOTICE below if you want to use this.
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.
175
Do call vhangup() for a virtually hangup of the specified terminal.
178
Try to keep the existing baud rate. The baud rates from
179
the command line are used when agetty receives a BREAK character.
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
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.
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.
198
Do not clear the screen before prompting for the login name
199
(the screen is normally cleared).
202
Do not print a newline before writing out /etc/issue.
205
By default the hostname will be printed. With this option enabled,
206
no hostname at all will be shown.
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.
214
Output version information and exit.
217
Output help screen and exit.
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.
224
For a hard-wired line or a console tty:
226
/sbin/agetty 9600 ttyS1
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:
232
/sbin/agetty \-L 9600 ttyS1 vt100
234
For a old style dial-in line with a 9600/2400/1200 baud modem:
236
/sbin/agetty \-mt60 ttyS1 9600,2400,1200
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.)
243
/sbin/agetty \-w \-I 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
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.
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.
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.
266
Insert the baudrate of the current line.
269
Insert the current date.
272
Insert the system name, the name of the operating system. Same as `uname \-s'.
275
Insert the name of the current tty line.
278
Insert the architecture identifier of the machine. Same as `uname \-m'.
281
Insert the nodename of the machine, also known as the hostname. Same as `uname \-n'.
284
Insert the NIS domainname of the machine. Same as `hostname \-d'.
287
Insert the DNS domainname of the machine.
290
Insert the release number of the OS. Same as `uname \-r'.
293
Insert the current time.
296
Insert the number of current users logged in.
299
Insert the string "1 user" or "<n> users" where <n> is the number of current
303
Insert the version of the OS, eg. the build-date etc.
305
Example: On my system, the following \fI/etc/issue\fP file:
310
This is \\n.\\o (\\s \\m \\r) \\t
315
This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
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.
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.
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.
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.
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.
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
356
Peter Orbaek <poe@daimi.aau.dk>
357
Linux port and more options. Still maintains the code.
359
Eric Rasmussen <ear@usfirst.org>
360
Added \-f option to display custom login messages on different terminals.
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/.