1.\" $NetBSD: getty.8,v 1.19 2020/02/26 15:44:57 riastradh Exp $ 2.\" 3.\" Copyright (c) 1980, 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: @(#)getty.8 8.1 (Berkeley) 6/4/93 31.\" 32.Dd May 29, 2013 33.Dt GETTY 8 34.Os 35.Sh NAME 36.Nm getty 37.Nd set terminal modes for system access 38.Sh SYNOPSIS 39.Nm 40.Oo 41.Ar type 42.Op Ar tty 43.Oc 44.Sh DESCRIPTION 45The 46.Nm 47program 48is called by 49.Xr init 8 50to open and initialize the tty line, read a login name, and invoke 51.Xr login 1 . 52The devices on which to run 53.Nm 54are normally determined by 55.Xr ttys 5 . 56.Pp 57The 58.Nm 59program can also recognize a Point to Point Protocol 60.Pq Tn PPP 61negotiation, and, if the 62.Sy pp 63attribute in 64.Xr gettytab 5 65is set, invoke the program given by that string, e.g., 66.Xr pppd 8 , 67instead of 68.Xr login 1 . 69This makes it possible to use a single serial port for either a 70.Qq shell 71account with command line interface, or a 72.Tn PPP 73network link. 74.Pp 75The argument 76.Ar tty 77is the special device file in 78.Pa /dev 79to open for the terminal 80.Po 81for example, 82.Qq ttyh0 83.Pc . 84If there is no argument or the argument is 85.Ql Fl , 86the tty line is assumed to be open as file descriptor 0. 87.Pp 88The 89.Ar type 90argument can be used to make 91.Nm 92treat the terminal line specially. 93This argument is used as an index into the 94.Xr gettytab 5 95database, to determine the characteristics of the line. 96If there is no argument, or there is no such table, the 97.Em default 98table is used. 99If there is no 100.Pa /etc/gettytab 101a set of system defaults is used. 102If indicated by the table located, 103.Nm 104will clear the terminal screen, 105print a banner heading, 106and prompt for a login name. 107Usually either the banner or the login prompt will include 108the system hostname. 109.Pp 110.Nm 111uses the 112.Xr ttyaction 3 113facility with an action of 114.Qq getty 115and user 116.Qq root 117to execute site-specific commands when it starts. 118.Pp 119Most of the default actions of 120.Nm 121can be circumvented, or modified, by a suitable 122.Xr gettytab 5 123table. 124.Pp 125The 126.Nm 127program can be set to timeout after some interval, 128which will cause dial up lines to hang up 129if the login name is not entered reasonably quickly. 130.Sh FILES 131.Bl -tag -width /usr/libexec/getty -compact 132.It Pa /etc/gettytab 133.It Pa /etc/ttys 134.It Pa /usr/libexec/getty 135.El 136.Sh DIAGNOSTICS 137.Bl -diag 138.It "ttyxx: No such device or address." 139.It "ttyxx: No such file or address." 140A terminal which is turned on in the 141.Xr ttys 5 142file cannot be opened, likely because the requisite 143lines are either not configured into the system, the associated device 144was not attached during boot-time system configuration, 145or the special file in 146.Pa /dev 147does not exist. 148.El 149.Sh SEE ALSO 150.Xr login 1 , 151.Xr ioctl 2 , 152.Xr ttyaction 3 , 153.Xr tty 4 , 154.Xr gettytab 5 , 155.Xr ttys 5 , 156.Xr init 8 , 157.Xr pppd 8 158.Sh HISTORY 159A 160.Nm 161program appeared in 162.At v6 . 163