getty (8) Linux Manual Page
agetty – alternative Linux getty
Synopsis
agetty [options] port [baud_rate…] [term]
Description
agetty opens a tty port, prompts for a login name and invokes the /bin/login command. It is normally invoked by init(8).
agetty has several non-standard features that are useful for hardwired and for dial-in lines:
- • Adapts the tty settings to parity bits and to erase, kill, end-of-line and uppercase characters when it reads a login name. The program can handle 7-bit characters with even, odd, none or space parity, and 8-bit characters with no parity. The following special characters are recognized: Control-U (kill); DEL and backspace (erase); carriage return and line feed (end of line). See also the
–erase-charsand–kill-charsoptions.
- • Optionally deduces the baud rate from the CONNECT messages produced by Hayes(tm)-compatible modems.
- • Optionally does not hang up when it is given an already opened line (useful for call-back applications).
- • Optionally does not display the contents of the /etc/issue file.
- • Optionally displays an alternative issue files or directories instead of /etc/issue or /etc/issue.d.
- • Optionally does not ask for a login name.
- • Optionally invokes a non-standard login program instead of /bin/login.
- • Optionally turns on hardware flow control.
- • Optionally forces the line to be local with no need for carrier detect.
This program does not use the /etc/gettydefs (System V) or /etc/gettytab (SunOS 4) files.
Arguments
port
- A path name relative to the /dev directory. If a "-" is specified,
agettyassumes that its standard input is already connected to a tty port and that a connection to a remote user has already been established.Under System V, a "-" port argument should be preceded by a "–".
baud_rate,…
- A comma-separated list of one or more baud rates. Each time
agettyreceives a BREAK character it advances through the list, which is treated as if it were circular.Baud rates should be specified in descending order, so that the null character (Ctrl-@) can also be used for baud-rate switching.
This argument is optional and unnecessary for
virtual terminals.The default for
serial terminalsis keep the current baud rate (see–keep-baud) and if unsuccessful then default to ‘9600’.
term
- The value to be used for the
TERMenvironment variable. This overrides whateverinit(1) may have set, and is inherited by login and the shell.The default is ‘vt100’, or ‘linux’ for Linux on a virtual terminal, or ‘hurd’ for GNU Hurd on a virtual terminal.
Options
-8, –8bits
- Assume that the tty is 8-bit clean, hence disable parity detection.
-a, –autologin username
- Automatically log in the specified user without asking for a username or password. Using this option causes an
-fusername option and argument to be added to the/bin/logincommand line. See–login-options, which can be used to modify this option’s behavior.Note that
–autologinmay affect the way in whichgettyinitializes the serial line, because on auto-loginagettydoes not read from the line and it has no opportunity optimize the line setting.
-c, –noreset
- Do not reset terminal cflags (control modes). See
termios(3) for more details.
-E, –remote
- Typically the
login(1) command is given a remote hostname when called by something such astelnetd(8). This option allowsagettyto pass what it is using for a hostname tologin(1) for use inutmp(5). See–host,login(1), andutmp(5).If the
–hostfakehost option is given, then an-hfakehost option and argument are added to the /bin/login command line.If the
–nohostnameoption is given, then an-Hoption is added to the/bin/logincommand line.See
–login-options.
-f, –issue-file path
- Specifies a ":" delimited list of files and directories to be displayed instead of /etc/issue (or other). All specified files and directories are displayed, missing or empty files are silently ignored. If the specified path is a directory then display all files with .issue file extension in version-sort order from the directory. This allows custom messages to be displayed on different terminals. The
–noissueoption will override this option.
–show-issue
- Display the current issue file (or other) on the current terminal and exit. Use this option to review the current setting, it is not designed for any other purpose. Note that output may use some default or incomplete information as proper output depends on terminal and agetty command line.
-h, –flow-control
- Enable hardware (RTS/CTS) flow control. It is left up to the application to disable software (XON/XOFF) flow protocol where appropriate.
-H, –host fakehost
- Write the specified fakehost into the utmp file. Normally, no login host is given, since
agettyis used for local hardwired connections and consoles. However, this option can be useful for identifying terminal concentrators and the like.
-i, –noissue
- Do not display the contents of /etc/issue (or other) before writing the login prompt. Terminals or communications hardware may become confused when receiving lots of text at the wrong baud rate; dial-up scripts may fail if the login prompt is preceded by too much text.
-I, –init-string initstring
- Set an initial string to be sent to the tty or modem before sending anything else. This may be used to initialize a modem. Non-printable characters may be sent by writing their octal code preceded by a backslash (\). For example, to send a linefeed character (ASCII 10, octal 012), write \12.
-J, –noclear
- Do not clear the screen before prompting for the login name. By default the screen is cleared.
-l, –login-program login_program
- Invoke the specified login_program instead of /bin/login. This allows the use of a non-standard login program. Such a program could, for example, ask for a dial-up password or use a different password file. See
–login-options.
-L, –local-line[=mode]
- Control the CLOCAL line flag. The optional mode argument is ‘auto’, ‘always’ or ‘never’. If the mode argument is omitted, then the default is ‘always’. If the
–local-lineoption is not given at all, then the default is ‘auto’.always
- Forces the line to be a local line with no need for carrier detect. This can be useful when you have a locally attached terminal where the serial line does not set the carrier-detect signal.
never
- Explicitly clears the CLOCAL flag from the line setting and the carrier-detect signal is expected on the line.
auto
- The
agettydefault. Does not modify the CLOCAL setting and follows the setting enabled by the kernel.
-m, –extract-baud
- Try to extract the baud rate from the CONNECT status message produced by Hayes(tm)-compatible modems. These status messages are of the form: "<junk><speed><junk>".
agettyassumes that the modem emits its status message at the same speed as specified with (the first) baud_rate value on the command line.Since the
–extract-baudfeature may fail on heavily-loaded systems, you still should enable BREAK processing by enumerating all expected baud rates on the command line.
–list-speeds
- Display supported baud rates. These are determined at compilation time.
-n, –skip-login
- Do not prompt the user for a login name. This can be used in connection with the
–login-programoption to invoke a non-standard login process such as a BBS system. Note that with the–skip-loginoption,agettygets no input from the user who logs in and therefore will not be able to figure out parity, character size, and newline processing of the connection. It defaults to space parity, 7 bit characters, and ASCII CR (13) end-of-line character. Beware that the program thatagettystarts (usually /bin/login) is run as root.
-N, –nonewline
- Do not print a newline before writing out /etc/issue.
-o, –login-options login_options
- Options and arguments that are passed to
login(1). Where
