1.\" $OpenBSD: ttys.5,v 1.13 2020/02/08 01:09:57 jsg Exp $ 2.\" Copyright (c) 1985, 1991, 1993 3.\" The Regents of the University of California. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. Neither the name of the University nor the names of its contributors 14.\" may be used to endorse or promote products derived from this software 15.\" without specific prior written permission. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" 29.\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 30.\" 31.Dd $Mdocdate: February 8 2020 $ 32.Dt TTYS 5 33.Os 34.Sh NAME 35.Nm ttys 36.Nd terminal initialization information 37.Sh DESCRIPTION 38The 39.Nm 40file contains information that is used by various routines to initialize 41and control the use of terminal special files. 42This information is read with the 43.Xr getttyent 3 44library routines. 45There is one line in the 46.Nm 47file per special device file. 48Fields are separated by tabs and/or spaces. 49Fields comprised of more than one word should be enclosed in double quotes 50.Pq Ql \&" . 51Blank lines and comments may appear anywhere in the file; comments 52are delimited by hash marks 53.Pq Ql # 54and newlines. 55Any unspecified fields will default to null. 56.Pp 57The first field is the 58name of the terminal special file as it is found in 59.Pa /dev . 60.Pp 61The second field of the file is the command to execute for the line, 62usually 63.Xr getty 8 , 64which initializes and opens the line, setting the speed, waiting for 65a user name and executing the 66.Xr login 1 67program. 68It can be, however, any desired command, for example 69the start up for a window system terminal emulator or some other 70daemon process, and can contain multiple words if quoted. 71.Pp 72The third field is the type of terminal usually connected to that 73TTY line, normally the one found in the 74.Xr termcap 5 75database file. 76The environment variable 77.Dv TERM 78is initialized with the value by either 79.Xr getty 8 80or 81.Xr login 1 . 82.Pp 83The remaining fields set flags in the 84.Fa ty_status 85entry (see 86.Xr getttyent 3 ) 87or specify a window system process that 88.Xr init 8 89will maintain for the terminal line. 90The following is a list of permitted flags for each TTY: 91.Bl -tag -width xxxxxxx 92.It Ar on 93Specify that 94.Xr init 8 95should execute the command given in the second field. 96.It Ar off 97The opposite of on. 98.It Ar secure 99If 100.Ar on 101is also specified, allows users with a UID of 0 to log in on this line. 102If set for the 103.Ar console 104entry, then 105.Xr init 8 106will start a single-user shell without asking for the superuser password. 107.El 108.Pp 109Additionally, the following flags modify the default behavior of 110the terminal line. 111Some of these flags may not be supported by a terminal line driver. 112The flag fields should not be quoted. 113.Bl -tag -width xxxxxxx 114.It Ar local 115Treat the line as if it is locally connected. 116.It Ar rtscts 117Use RTS/CTS hardware flow control, if 118possible. 119.It Ar mdmbuf 120Use DTR/DCD flow control if possible. 121.It Ar softcar 122Ignore hardware carrier on the line. 123.El 124.Pp 125The string 126.Ar window= 127may be followed by a quoted command string which 128.Xr init 8 129will execute 130.Em before 131starting the command specified by the second field. 132.Pp 133Changes to the ttys file take effect after it has been reloaded by 134.Xr init 8 , 135which can be triggered by sending it a 136.Dv HUP 137signal. 138.Sh FILES 139.Bl -tag -width /etc/ttys -compact 140.It Pa /etc/ttys 141.El 142.Sh EXAMPLES 143.Bd -literal 144# root login on console at 1200 baud 145console "/usr/libexec/getty std.1200" vt100 on secure 146# dialup at 1200 baud, no root logins 147ttyd0 "/usr/libexec/getty d1200" dialup on # 555-1234 148# Mike's terminal: hp2621 149ttyh0 "/usr/libexec/getty std.9600" hp2621-nl on # 457 Evans 150# John's terminal: vt100 151ttyh1 "/usr/libexec/getty std.9600" vt100 on # 459 Evans 152# terminal emulate/window system 153ttyv0 "/usr/new/xterm -L :0" vs100 on window="/usr/new/Xvs100 0" 154# Network pseudo ttys -- don't enable getty 155ttyp0 none network 156ttyp1 none network off 157.Ed 158.Sh SEE ALSO 159.Xr login 1 , 160.Xr getttyent 3 , 161.Xr ttyslot 3 , 162.Xr gettytab 5 , 163.Xr termcap 5 , 164.Xr getty 8 , 165.Xr init 8 , 166.Xr ttyflags 8 167.Sh HISTORY 168A 169.Nm 170file appeared in 171.At v5 . 172