1.\" Copyright (c) 1985, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 29.\" " 30.Dd June 1, 2021 31.Dt TTYS 5 32.Os 33.Sh NAME 34.Nm ttys 35.Nd terminal initialization information 36.Sh DESCRIPTION 37The file 38.Nm 39contains information that is used by various routines to initialize 40and control the use of terminal special files. 41Pseudo-terminals (see 42.Xr pts 4 ) 43are not listed. 44This information is read with the 45.Xr getttyent 3 46library routines. 47There is one line in the 48.Nm 49file per special device file. 50Fields are separated by tabs and/or spaces. 51Fields comprised of more than one word should be enclosed in double 52quotes (``"''). 53Blank lines and comments may appear anywhere in the file; comments 54are delimited by hash marks (``#'') and new lines. 55Any unspecified fields will default to null. 56.Pp 57The first field is normally the 58name of the terminal special file as it is found in 59.Pa /dev . 60However, it can be any arbitrary string 61when the associated command is not related to a tty. 62.Pp 63The second field of the file is the command to execute for the line, 64usually 65.Xr getty 8 , 66which initializes and opens the line, setting the speed, waiting for 67a user name and executing the 68.Xr login 1 69program. 70It can be, however, any desired command, for example 71the start up for a window system terminal emulator or some other 72daemon process, and can contain multiple words if quoted. 73.Pp 74The third field is the type of terminal usually connected to that 75tty line, normally the one found in the 76.Xr termcap 5 77data base file. 78The environment variable 79.Ev TERM 80is initialized with the value by 81either 82.Xr getty 8 83or 84.Xr login 1 . 85.Pp 86The remaining fields set flags in the 87.Fa ty_status 88entry (see 89.Xr getttyent 3 ) , 90specify a window system process that 91.Xr init 8 92will maintain for the terminal line, optionally determine the 93type of tty (whether dialin, network or otherwise), 94or specify a tty group 95name that allows the login class database (see 96.Xr login.conf 5 ) 97to refer to many ttys as a group, to selectively allow or 98deny access or enable or disable accounting facilities for 99ttys as a group. 100.Pp 101As flag values, the strings ``on'' and ``off'' specify that 102.Xr init 8 103should (should not) execute the command given in the second field. 104``onifconsole'' will cause this line to be enabled if and only if it is 105an active kernel console device (it is equivalent to ``on'' in this 106case). 107The flag ``onifexists'' will cause this line to be enabled if and only 108if the name exists. 109If the name starts with a ``/'', it will be considered an absolute 110path. 111Otherwise, it is considered a path relative to 112.Pa /dev . 113The flag ``secure'' (if the console is enabled) allows users with a 114uid of 0 to login on 115this line. 116The flag ``dialup'' indicates that a tty entry describes a dialin 117line, and ``network'' is obsolete and does nothing. 118Either of these strings may also be specified in the terminal type 119field. 120The string ``window='' may be followed by a quoted command 121string which 122.Xr init 8 123will execute 124.Em before 125starting the command specified by the second field. 126.Pp 127The string ``group='' may be followed by a group name comprised of 128alphanumeric characters that can be used by 129.Xr login.conf 5 130to refer to many tty lines as a group to enable or disable access 131and accounting facilities. 132If no group is specified, then the tty becomes a member of the group 133"none". 134For backwards compatibility, the ``group='' should appear last on the 135line, immediately before the optional comment. 136.Pp 137Both the second field and any command specified with ``window='' 138will be split into words and executed using 139.Xr execve 2 . 140Words are separated by any combinations of tabs and spaces. 141Arguments containing whitespace should be enclosed in single quotes 142.Pq Li ' . 143Note that no shell-style globbing or other variable substitution occurs. 144.Sh FILES 145.Bl -tag -width /etc/ttys -compact 146.It Pa /etc/ttys 147.El 148.Sh EXAMPLES 149.Bd -literal 150# root login on console at 1200 baud 151console "/usr/libexec/getty std.1200" vt100 on secure 152# dialup at 1200 baud, no root logins 153ttyd0 "/usr/libexec/getty d1200" dialup on group=dialup # 555-1234 154# Mike's terminal: hp2621 155ttyh0 "/usr/libexec/getty std.9600" hp2621-nl on group=dialup # 457 Evans 156# John's terminal: vt100 157ttyh1 "/usr/libexec/getty std.9600" vt100 on group=dialup # 459 Evans 158# terminal emulate/window system 159ttyv0 "/usr/local/bin/xterm -display :0" xterm on window="/usr/local/bin/X :0" 160.Ed 161.Sh SEE ALSO 162.Xr login 1 , 163.Xr getttyent 3 , 164.Xr nmdm 4 , 165.Xr uart 4 , 166.Xr ucom 4 , 167.Xr gettytab 5 , 168.Xr login.conf 5 , 169.Xr termcap 5 , 170.Xr getty 8 , 171.Xr init 8 , 172.Xr pam_securetty 8 , 173.Xr pstat 8 174.Sh HISTORY 175A 176.Nm 177file appeared in 178.At v6 . 179