1AGETTY(8) System Manager's Manual AGETTY(8)
2
3
4
6 agetty - alternative Linux getty
7
8
10 agetty [-8ihLmnUw] [-f issue_file] [-l login_program] [-I init] [-t
11 timeout] [-H login_host] port baud_rate,... [term]
12 agetty [-8ihLmnw] [-f issue_file] [-l login_program] [-I init] [-t
13 timeout] [-H login_host] baud_rate,... port [term]
14
15
17 agetty opens a tty port, prompts for a login name and invokes the
18 /bin/login command. It is normally invoked by init(8).
19
20 agetty has several non-standard features that are useful for hard-wired
21 and for dial-in lines:
22
23 o Adapts the tty settings to parity bits and to erase, kill, end-
24 of-line and uppercase characters when it reads a login name.
25 The program can handle 7-bit characters with even, odd, none or
26 space parity, and 8-bit characters with no parity. The following
27 special characters are recognized: @ and Control-U (kill); #,
28 DEL and back space (erase); carriage return and line feed (end
29 of line). See also --erase-chars and --kill-chars options.
30
31 o Optionally deduces the baud rate from the CONNECT messages pro‐
32 duced by Hayes(tm)-compatible modems.
33
34 o Optionally does not hang up when it is given an already opened
35 line (useful for call-back applications).
36
37 o Optionally does not display the contents of the /etc/issue file.
38
39 o Optionally displays an alternative issue file instead of
40 /etc/issue.
41
42 o Optionally does not ask for a login name.
43
44 o Optionally invokes a non-standard login program instead of
45 /bin/login.
46
47 o Optionally turns on hard-ware flow control
48
49 o Optionally forces the line to be local with no need for carrier
50 detect.
51
52 This program does not use the /etc/gettydefs (System V) or /etc/get‐
53 tytab (SunOS 4) files.
54
56 port A path name relative to the /dev directory. If a "-" is speci‐
57 fied, agetty assumes that its standard input is already con‐
58 nected to a tty port and that a connection to a remote user has
59 already been established.
60
61 Under System V, a "-" port argument should be preceded by a
62 "--".
63
64 baud_rate,...
65 A comma-separated list of one or more baud rates. Each time
66 agetty receives a BREAK character it advances through the list,
67 which is treated as if it were circular.
68
69 Baud rates should be specified in descending order, so that the
70 null character (Ctrl-@) can also be used for baud rate switch‐
71 ing.
72
73 term The value to be used for the TERM environment variable. This
74 overrides whatever init(8) may have set, and is inherited by
75 login and the shell.
76
78 -8 Assume that the tty is 8-bit clean, hence disable parity detec‐
79 tion.
80
81 -h Enable hardware (RTS/CTS) flow control. It is left up to the
82 application to disable software (XON/XOFF) flow protocol where
83 appropriate.
84
85 -i Do not display the contents of /etc/issue (or other) before
86 writing the login prompt. Terminals or communications hardware
87 may become confused when receiving lots of text at the wrong
88 baud rate; dial-up scripts may fail if the login prompt is pre‐
89 ceded by too much text.
90
91 -E If -H fakehost option is given then -h fakehost options is added
92 to the the /bin/login command line.
93
94 -f issue_file
95 Display the contents of issue_file instead of /etc/issue. This
96 allows custom messages to be displayed on different terminals.
97 The -i option will override this option.
98
99 -I initstring
100 Set an initial string to be sent to the tty or modem before
101 sending anything else. This may be used to initialize a modem.
102 Non printable characters may be sent by writing their octal code
103 preceded by a backslash (\). For example to send a linefeed
104 character (ASCII 10, octal 012) write \012.
105
106 -l login_program
107 Invoke the specified login_program instead of /bin/login. This
108 allows the use of a non-standard login program (for example, one
109 that asks for a dial-up password or that uses a different pass‐
110 word file).
111
112 -H login_host
113 Write the specified login_host into the utmp file. (Normally, no
114 login host is given, since agetty is used for local hardwired
115 connections and consoles. However, this option can be useful for
116 identifying terminal concentrators and the like.
117
118 -L [=mode]
119 Control CLOCAL line flag, the optional argument mode is 'auto',
120 'always' or 'never'. If the mode argument is omitted then the
121 default is 'always'. If the -L option is ommitted at all then
122 the default is 'auto'.
123
124 The mode 'always' forces the line to be a local line with no
125 need for carrier detect. This can be useful when you have a
126 locally attached terminal where the serial line does not set the
127 carrier detect signal.
128
129 The mode 'never' explicitly clears CLOCAL flags from line set‐
130 ting and the carrier detect signal is expected on the line.
131
132 The mode 'auto' (agetty default) does not modify CLOCAL setting
133 and follows the setting enabled by kernel.
134
135 -m Try to extract the baud rate the CONNECT status message produced
136 by Hayes(tm)-compatible modems. These status messages are of the
137 form: "<junk><speed><junk>". agetty assumes that the modem
138 emits its status message at the same speed as specified with
139 (the first) baud_rate value on the command line.
140
141 Since the -m feature may fail on heavily-loaded systems, you
142 still should enable BREAK processing by enumerating all expected
143 baud rates on the command line.
144
145 -n Do not prompt the user for a login name. This can be used in
146 connection with -l option to invoke a non-standard login process
147 such as a BBS system. Note that with the -n option, agetty gets
148 no input from user who logs in and therefore won't be able to
149 figure out parity, character size, and newline processing of the
150 connection. It defaults to space parity, 7 bit characters, and
151 ASCII CR (13) end-of-line character. Beware that the program
152 that agetty starts (usually /bin/login) is run as root.
153
154 -t timeout
155 Terminate if no user name could be read within timeout seconds.
156 This option should probably not be used with hard-wired lines.
157
158 -L Force the line to be a local line with no need for carrier
159 detect. This can be useful when you have a locally attached ter‐
160 minal where the serial line does not set the carrier detect sig‐
161 nal.
162
163 -U Turn on support for detecting an uppercase only terminal. This
164 setting will detect a login name containing only capitals as
165 indicating an uppercase only terminal and turn on some upper to
166 lower case conversions. Note that this has no support for any
167 unicode characters.
168
169 -w Wait for the user or the modem to send a carriage-return or a
170 linefeed character before sending the /etc/issue (or other) file
171 and the login prompt. Very useful in connection with the -I
172 option.
173
174 --erase-chars string
175 This option specifies additional chars that should be inter‐
176 preted as a backspace (ignore previous char) when user specifies
177 login name. The default is ´#´, specify empty string to disable
178 the default.
179
180 --kill-chars string
181 This option specifies additional chars that should be inter‐
182 preted as a kill (ignore all previous chars) when user specifies
183 login name. The default is ´@´, specify empty string to disable
184 the default.
185
187 This section shows examples for the process field of an entry in the
188 /etc/inittab file. You'll have to prepend appropriate values for the
189 other fields. See inittab(5) for more details.
190
191 For a hard-wired line or a console tty:
192 /sbin/agetty 9600 ttyS1
193
194 For a directly connected terminal without proper carriage detect
195 wiring: (try this if your terminal just sleeps instead of giving you a
196 password: prompt.)
197 /sbin/agetty -L 9600 ttyS1 vt100
198
199 For a old style dial-in line with a 9600/2400/1200 baud modem:
200 /sbin/agetty -mt60 ttyS1 9600,2400,1200
201
202 For a Hayes modem with a fixed 115200 bps interface to the machine:
203 (the example init string turns off modem echo and result codes, makes
204 modem/computer DCD track modem/modem DCD, makes a DTR drop cause a dis-
205 connection and turn on auto-answer after 1 ring.)
206 /sbin/agetty -w -I 'ATE0Q1&D2&C1S0=1\015' 115200 ttyS1
207
208
210 The issue-file (/etc/issue or the file set with the -f option) may con‐
211 tain certain escape codes to display the system name, date and time
212 etc. All escape codes consist of a backslash (\) immediately followed
213 by one of the letters explained below.
214
215
216 b Insert the baudrate of the current line.
217
218 d Insert the current date.
219
220 s Insert the system name, the name of the operating system.
221
222 l Insert the name of the current tty line.
223
224 m Insert the architecture identifier of the machine, eg. i486
225
226 n Insert the nodename of the machine, also known as the hostname.
227
228 o Insert the NIS domainname of the machine.
229
230 O Insert the DNS domainname of the machine.
231
232 r Insert the release number of the OS, eg. 1.1.9.
233
234 t Insert the current time.
235
236 u Insert the number of current users logged in.
237
238 U Insert the string "1 user" or "<n> users" where <n> is the num‐
239 ber of current users logged in.
240
241 v Insert the version of the OS, eg. the build-date etc.
242
243 Example: On my system, the following /etc/issue file:
244
245 This is \n.\o (\s \m \r) \t
246
247 displays as
248
249 This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
250
251
252
254 /var/run/utmp, the system status file.
255 /etc/issue, printed before the login prompt.
256 /dev/console, problem reports (if syslog(3) is not used).
257 /etc/inittab, init(8) configuration file.
258
260 The baud-rate detection feature (the -m option) requires that agetty be
261 scheduled soon enough after completion of a dial-in call (within 30 ms
262 with modems that talk at 2400 baud). For robustness, always use the -m
263 option in combination with a multiple baud rate command-line argument,
264 so that BREAK processing is enabled.
265
266 The text in the /etc/issue file (or other) and the login prompt are
267 always output with 7-bit characters and space parity.
268
269 The baud-rate detection feature (the -m option) requires that the modem
270 emits its status message after raising the DCD line.
271
273 Depending on how the program was configured, all diagnostics are writ‐
274 ten to the console device or reported via the syslog(3) facility.
275 Error messages are produced if the port argument does not specify a
276 terminal device; if there is no utmp entry for the current process
277 (System V only); and so on.
278
280 W.Z. Venema <wietse@wzv.win.tue.nl>
281 Eindhoven University of Technology
282 Department of Mathematics and Computer Science
283 Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
284
285 Peter Orbaek <poe@daimi.aau.dk>
286 Linux port and more options. Still maintains the code.
287
288 Eric Rasmussen <ear@usfirst.org>
289 Added -f option to display custom login messages on different terminals.
290
291
293 The agetty command is part of the util-linux-ng package and is avail‐
294 able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
295
296
297
298 AGETTY(8)