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