xref: /freebsd/libexec/getty/ttys.5 (revision 02e9120893770924227138ba49df1edb3896112a)
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.Dd October 26, 2023
29.Dt TTYS 5
30.Os
31.Sh NAME
32.Nm ttys
33.Nd terminal initialization information
34.Sh DESCRIPTION
35The file
36.Nm
37contains information that is used by various routines to initialize
38and control the use of terminal special files.
39Pseudo-terminals (see
40.Xr pts 4 )
41are not listed.
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
50quotes (``"'').
51Blank lines and comments may appear anywhere in the file; comments
52are delimited by hash marks (``#'') and new lines.
53Any unspecified fields will default to null.
54.Pp
55The first field is normally the
56name of the terminal special file as it is found in
57.Pa /dev .
58However, it can be any arbitrary string
59when the associated command is not related to a tty.
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
75data base file.
76The environment variable
77.Ev TERM
78is initialized with the value by
79either
80.Xr getty 8
81or
82.Xr login 1 .
83.Pp
84The remaining fields set flags in the
85.Fa ty_status
86entry (see
87.Xr getttyent 3 ) ,
88specify a window system process that
89.Xr init 8
90will maintain for the terminal line, optionally determine the
91type of tty (whether dialin, network or otherwise),
92or specify a tty group
93name that allows the login class database (see
94.Xr login.conf 5 )
95to refer to many ttys as a group, to selectively allow or
96deny access or enable or disable accounting facilities for
97ttys as a group.
98.Pp
99As flag values, the strings ``on'' and ``off'' specify that
100.Xr init 8
101should (should not) execute the command given in the second field.
102``onifconsole'' will cause this line to be enabled if and only if it is
103an active kernel console device (it is equivalent to ``on'' in this
104case).
105The flag ``onifexists'' will cause this line to be enabled if and only
106if the name exists.
107If the name starts with a ``/'', it will be considered an absolute
108path.
109Otherwise, it is considered a path relative to
110.Pa /dev .
111The flag ``secure'' (if the console is enabled) allows users with a
112uid of 0 to login on this line.
113The flag ``insecure'' as well as the absence of the ``secure'' flag
114disallows users with uid of 0 to login on this line.
115The flag ``dialup'' indicates that a tty entry describes a dialin
116line, and ``network'' is obsolete and does nothing.
117Either of these strings may also be specified in the terminal type
118field.
119The string ``window='' may be followed by a quoted command
120string which
121.Xr init 8
122will execute
123.Em before
124starting the command specified by the second field.
125.Pp
126The string ``group='' may be followed by a group name comprised of
127alphanumeric characters that can be used by
128.Xr login.conf 5
129to refer to many tty lines as a group to enable or disable access
130and accounting facilities.
131If no group is specified, then the tty becomes a member of the group
132"none".
133For backwards compatibility, the ``group='' should appear last on the
134line, immediately before the optional comment.
135.Pp
136Both the second field and any command specified with ``window=''
137will be split into words and executed using
138.Xr execve 2 .
139Words are separated by any combinations of tabs and spaces.
140Arguments containing whitespace should be enclosed in single quotes
141.Pq Li ' .
142Note that no shell-style globbing or other variable substitution occurs.
143.Sh FILES
144.Bl -tag -width /etc/ttys -compact
145.It Pa /etc/ttys
146.El
147.Sh EXAMPLES
148.Bd -literal
149# root login on console at 1200 baud
150console	"/usr/libexec/getty std.1200"	vt100	on secure
151# dialup at 1200 baud, no root logins
152ttyd0	"/usr/libexec/getty d1200"	dialup	on group=dialup	# 555-1234
153# Mike's terminal: hp2621
154ttyh0	"/usr/libexec/getty std.9600"	hp2621-nl	on group=dialup	# 457 Evans
155# John's terminal: vt100
156ttyh1	"/usr/libexec/getty std.9600"	vt100	on group=dialup		# 459 Evans
157# terminal emulate/window system
158ttyv0	"/usr/local/bin/xterm -display :0"	xterm	on window="/usr/local/bin/X :0"
159.Ed
160.Sh SEE ALSO
161.Xr login 1 ,
162.Xr getttyent 3 ,
163.Xr nmdm 4 ,
164.Xr uart 4 ,
165.Xr ucom 4 ,
166.Xr gettytab 5 ,
167.Xr login.conf 5 ,
168.Xr termcap 5 ,
169.Xr getty 8 ,
170.Xr init 8 ,
171.Xr pam_securetty 8 ,
172.Xr pstat 8
173.Sh HISTORY
174A
175.Nm
176file appeared in
177.At v6 .
178