Merge branch 'vendor/GCC50'
[dragonfly.git] / libexec / getty / ttys.5
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 .\" $FreeBSD: src/libexec/getty/ttys.5,v 1.11.2.3 2001/08/16 10:44:15 ru Exp $
30 .\" $DragonFly: src/libexec/getty/ttys.5,v 1.3 2006/02/17 19:33:31 swildner Exp $
31 .\" "
32 .Dd November 17, 1996
33 .Dt TTYS 5
34 .Os
35 .Sh NAME
36 .Nm ttys
37 .Nd terminal initialization information
38 .Sh DESCRIPTION
39 The file
40 .Nm
41 contains information that is used by various routines to initialize
42 and control the use of terminal special files.
43 This information is read with the
44 .Xr getttyent 3
45 library routines.
46 There is one line in the
47 .Nm
48 file per special device file.
49 Fields are separated by tabs and/or spaces.
50 Fields comprised of more than one word should be enclosed in double
51 quotes (``"'').
52 Blank lines and comments may appear anywhere in the file; comments
53 are delimited by hash marks (``#'') and new lines.
54 Any unspecified fields will default to null.
55 .Pp
56 The first field is normally the
57 name of the terminal special file as it is found in
58 .Pa /dev .
59 However, it can be any arbitrary string
60 when the associated command is not related to a tty.
61 .Pp
62 The second field of the file is the command to execute for the line,
63 usually
64 .Xr getty 8 ,
65 which initializes and opens the line, setting the speed, waiting for
66 a user name and executing the
67 .Xr login 1
68 program.
69 It can be, however, any desired command, for example
70 the start up for a window system terminal emulator or some other
71 daemon process, and can contain multiple words if quoted.
72 .Pp
73 The third field is the type of terminal usually connected to that
74 tty line, normally the one found in the
75 .Xr termcap 5
76 data base file.
77 The environment variable
78 .Ev TERM
79 is initialized with the value by
80 either
81 .Xr getty 8
82 or
83 .Xr login 1 .
84 .Pp
85 The remaining fields set flags in the
86 .Fa ty_status
87 entry (see
88 .Xr getttyent 3 ) ,
89 specify a window system process that
90 .Xr init 8
91 will maintain for the terminal line, optionally determine the
92 type of tty (whether dialin, network or otherwise),
93 or specify a tty group
94 name that allows the login class database (see
95 .Xr login.conf 5 )
96 to refer to many ttys as a group, to selectively allow or
97 deny access or enable or disable accounting facilities for
98 ttys as a group.
99 .Pp
100 As flag values, the strings ``on'' and ``off'' specify that
101 .Xr init 8
102 should (should not) execute the command given in the second field,
103 while ``secure'' (if ``on'' is also specified) allows users with a
104 uid of 0 to login on
105 this line.
106 The flag ``dialin'' indicates that a tty entry describes a dialin
107 line, and ``network'' indicates that a tty entry provides a
108 network connection.
109 Either of these strings may also be specified in the terminal type
110 field.
111 The string ``window='' may be followed by a quoted command
112 string which
113 .Xr init 8
114 will execute
115 .Em before
116 starting the command specified by the second field.
117 .Pp
118 The string ``group='' may be followed by a group name comprised of
119 alphanumeric characters that can be used by
120 .Xr login.conf 5
121 to refer to many tty lines as a group to enable or disable access
122 and accounting facilities.
123 If no group is specified, then the tty becomes a member of the group
124 "none".
125 For backwards compatibility, the ``group='' should appear last on the
126 line, immediately before the optional comment.
127 .Pp
128 Both the second field and any command specified with ``window=''
129 will be split into words and executed using
130 .Xr execve 2 .
131 Words are separated by any combinations of tabs and spaces.
132 Arguments containing whitespace should be enclosed in single quotes
133 .Pq Li ' .
134 Note that no shell-style globbing or other variable substitution occurs.
135 .Sh FILES
136 .Bl -tag -width /etc/ttys -compact
137 .It Pa /etc/ttys
138 .El
139 .Sh EXAMPLES
140 .Bd -literal
141 # root login on console at 1200 baud
142 console "/usr/libexec/getty std.1200"   vt100   on secure
143 # dialup at 1200 baud, no root logins
144 ttyd0   "/usr/libexec/getty d1200"      dialup  on group=dialup # 555-1234
145 # Mike's terminal: hp2621
146 ttyh0   "/usr/libexec/getty std.9600"   hp2621-nl       on group=dialup # 457 Evans
147 # John's terminal: vt100
148 ttyh1   "/usr/libexec/getty std.9600"   vt100   on group=dialup         # 459 Evans
149 # terminal emulate/window system
150 ttyv0   "/usr/new/xterm -L :0"          vs100   on window="/usr/new/Xvs100 0"
151 # Network pseudo ttys -- don't enable getty
152 ttyp0   none    network         group=pty
153 ttyp1   none    network off     group=pty
154 .Ed
155 .Sh SEE ALSO
156 .Xr login 1 ,
157 .Xr getttyent 3 ,
158 .Xr ttyslot 3 ,
159 .Xr gettytab 5 ,
160 .Xr login.conf 5 ,
161 .Xr termcap 5 ,
162 .Xr getty 8 ,
163 .Xr init 8
164 .\".Xr init 8 ,
165 .\".Xr ttyflags 8
166 .Sh HISTORY
167 A
168 .Nm
169 file appeared in
170 .At v6 .