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