ttys(5)
Name
ttys − terminal initialization data
Description
The /etc/ttys file contains information used by various routines to initialize and control the use of terminal special files. This file is created when the system is installed and can be updated at any time.
Each terminal special file ( /dev/ttyxx ) has a line in the ttys file. Each line contains several fields. Fields are separated by tabs or spaces. A field with more than one word should be enclosed in quotes. Blank lines and comments can appear anywhere in the file. Comments begin with a number sign (#) and are terminated by a newline character. Unspecified fields default to the empty string or zero, as appropriate.
The format of each line is as follows:
name command type flag1 flag2 ...
nameIs the name of the special file for the terminal in the /dev directory. Some examples are:
console
ttyd0
ttyd1
commandIs the command to be executed each time the terminal is initialized. This can happen when the system is booted, or when the superuser adds new terminals to the ttys file and initializes the new terminals. The command is usually getty, which performs such tasks as baud-rate recognition, reading the login name, and calling login. It can be any command you wish, such as the startup command for a window system terminal emulator or a command to maintain other daemon processes.
typeIs the type of terminal normally connected to the terminal special file. You can find the possible types by examining the /etc/termcap file on your system. The types available are given as the third field in entries in that file. Some examples are:
vt100
vt200
dialup
flagsAre the flags to be set in the ty_status or ty_window fields of the structure returned by the getttyent() routine. If the line ends in a comment, the comment is included in the ty_comment field of this structure.
These fields are used by the init command that is executed when terminals are initialized.
The ty_status flags are:
onSets the TTY_ON bit in the getttyent ty_status field. This enables logins for this terminal.
The default if this flag is not set is that logins are disabled for the terminal.
offClears the TTY_ON bit in the getttyent ty_status field. This disables logins for this terminal.
secureSets the TTY_SECURE bit in the getttyent ty_status field. This allows the root user to log in on this terminal. (The on flag should also be set.)
The default if this flag is not set is that the root user cannot log in on this terminal.
suSets the TTY_SU bit in the getttyent ty_status field, to allow a user to su to root.
The default if this flag is not set is that users cannot su to root on this terminal.
nomodemSets the TTY_LOCAL bit in the getttyent ty_status field. The line ignores modem signals. This is the default if neither the modem nor nomodem flag is set.
modemClears the TTY_LOCAL bit in the getttyent ty_status field. The line recognizes modem signals.
The default if this flag is not set is nomodem. That is, the line does not recognize modem signals.
sharedSets the TTY_SHARED bit in the getttyent ty_status field. The line can be used for both incoming and outgoing connections.
The default if this flag is not set is that the line cannot be used for incoming and outgoing connections.
termioSets the TTY_TERMIO bit in the getttyent ty_status field. This flag causes the terminal line to open with System Five default termio attributes. If the termio flag is not set, Berkeley compliant default terminal attributes are used.
The ty_window flag is:
window="string"
The quoted string is a window system process that init maintains for the terminal line.
Examples
The following example permits the root user to log in on the console at 1200 baud:
console "/etc/getty std.1200" vt100 on secure
This example allows dialup at 1200 baud without root login:
ttyd0 "/etc/getty d1200" dialup on
These two examples allow login at 9600 baud with two different terminal types: hp2621-nl and vt100. In this example, the terminals should be set up to operate in 7-bit mode, because the std.9600 gettytab entry is specified:
tty00 "/etc/getty std.9600" hp2621-nl on
tty01 "/etc/getty std.9600" vt100 on
This example shows the same two terminals as the previous example operating in full 8-bit mode. Note the use of a different gettytab entry:
tty00 "/etc/getty 8bit.9600" hp2621-nl on
tty01 "/etc/getty 8bit.9600" vt100 on
These two examples show network pseudoterminals, which should not have getty enabled:
ttyp0 none network
ttyp1 none network off
This example shows a terminal emulator and window-system startup entry and should be typed all on one line:
:0 "/usr/bin/login -P /usr/bin/Xprompter -C /usr/bin/dxsession -e" none
on secure window="/usr/bin/Xcfb"
This example shows an example of an entry for an lta device:
tty01 "/etc/getty 8bit.9600" vt100 on modem secure # LAT
Note
Any terminal configured to run getty in 8-bit mode should specify a gettytab entry that declares 8-bit operation. The command field of the ttys entry is used to specify the gettytab entry. If the terminal device is set up to operate in 8-bit mode and the command field does not specify an 8-bit gettytab entry, output to the terminal appears as multinational characters. These characters are the result of the getty program using the eighth bit of each character to represent parity attributes. By using an 8-bit gettytab entry, the high order bit of each character is unaffected by the getty program. The examples presented demonstrate the use of both 7- and 8-bit terminals.
Files
/etc/ttys The full pathname for the file
See Also
login(1), getttyent(3), gettytab(5), getty(8), init(8)
Guide to System Environment Setup