1.\" $NetBSD: gettytab.5,v 1.36 2012/04/21 12:27:28 roy Exp $ 2.\" 3.\" Copyright (c) 1983, 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: @(#)gettytab.5 8.4 (Berkeley) 4/19/94 31.\" 32.Dd April 5, 2012 33.Dt GETTYTAB 5 34.Os 35.Sh NAME 36.Nm gettytab 37.Nd terminal configuration data base 38.Sh SYNOPSIS 39.Nm 40.Sh DESCRIPTION 41The 42.Nm 43file 44is a simplified version of the 45.Xr capfile 5 46data base 47used to describe terminal lines. 48The initial terminal login process 49.Xr getty 8 50accesses the 51.Nm 52file each time it starts, allowing simpler 53reconfiguration of terminal characteristics. 54Each entry in the data base 55is used to describe one class of terminals. 56.Pp 57Where to run 58.Xr getty 8 59processes is normally defined by 60.Xr ttys 5 . 61.Pp 62There is a default terminal class, 63.Em default , 64that is used to set global defaults for all other classes. 65(That is, the 66.Em default 67entry is read, then the entry for the class required 68is used to override particular settings.) 69The 70.Em default 71entry is also normally read by other programs that present login prompts 72to the user, such as 73.Xr telnetd 8 , 74in order to retrieve the values of the 75.Em he , 76.Em hn , 77.Em im , 78and 79.Em if 80capabilities. 81.Sh CAPABILITIES 82Refer to 83.Xr capfile 5 84for a description of the file layout. 85The 86.Em default 87column below lists defaults obtained if there is 88no entry in the table obtained, nor one in the special 89.Em default 90table. 91.Bl -column Namexx /usr/bin/login Default 92.It Sy Name Type Default Description 93.It "ab bool false Auto-baud speed select mechanism for the Micom 600 portselector. Selection is done by looking at how the character `\er' is garbled at 300, 1200, 4800, and 9600 baud." 94.It "al str NULL user to auto-login instead of prompting" 95.It "ap bool false terminal uses any parity" 96.It "bk str 0377 alternative end of line character (input break)" 97.It "b2 str 0377 alternative end of line character (input break)" 98.It "c0 num unused tty control flags to write messages" 99.It "c1 num unused tty control flags to read login name" 100.It "c2 num unused tty control flags to leave terminal as" 101.It "ce bool false use crt erase algorithm" 102.It "ck bool false use crt kill algorithm" 103.It "cl str" Ta Dv NULL Ta 104.No "screen clear sequence" 105.It "co bool false console - add" 106.Ql \er\en 107after login prompt 108.It "cs bool false clear screen based on terminal type in /etc/ttys" 109.It "ds str" Ta So Li ^Y Sc Ta 110.No "delayed suspend character" 111.It "dx bool false set" 112.Dv DECCTLQ 113.It "ec bool false leave echo" 114.Tn OFF 115.It "ep bool false terminal uses even parity" 116.It "er str" Ta So Li ^? Sc Ta 117.No "erase character" 118.It "et str" Ta So Li ^D Sc Ta 119.No "end of text" 120.Pq Dv EOF 121character 122.It "ev str" Ta Dv NULL Ta 123.No "initial environment" 124.It "f0 num unused tty mode flags to write messages" 125.It "f1 num unused tty mode flags to read login name" 126.It "f2 num unused tty mode flags to leave terminal as" 127.It "fl str" Ta So Li ^O Sc Ta 128.No "output flush character" 129.It "hc bool false do" 130.Tn NOT 131hangup line on last close 132.It "he str" Ta Dv NULL Ta 133.No "hostname editing string" 134.It "hn str hostname hostname" 135.It "ht bool false terminal has real tabs" 136.It "i0 num unused tty input flags to write messages" 137.It "i1 num unused tty input flags to read login name" 138.It "i2 num unused tty input flags to leave terminal as" 139.It "if str NULL display named file before prompt, like /etc/issue" 140.It "ig bool false ignore garbage characters in login name" 141.It "im str" Ta Dv NULL Ta 142.No "initial (banner) message" 143.It "in str" Ta So Li ^C Sc Ta 144.No "interrupt character" 145.It "is num unused input speed" 146.It "kl str" Ta So Li ^U Sc Ta 147.No "kill character" 148.It "l0 num unused tty local flags to write messages" 149.It "l1 num unused tty local flags to read login name" 150.It "l2 num unused tty local flags to leave terminal as" 151.It "lc bool false terminal has lower case" 152.It "lm str login: login prompt" 153.It "ln str" Ta So Li ^V Sc Ta 154.No "``literal next'' character" 155.It "lo str" Ta Pa /usr/bin/login Ta 156.No "program to exec when name obtained" 157.It "mb bool false do flow control based on carrier" 158.It "nl bool false terminal has (or might have) a newline character" 159.It "nn bool false do not prompt for a login name" 160.It "np bool false terminal uses no parity (i.e. 8-bit characters)" 161.It "nx str default next table (for auto speed selection)" 162.It "o0 num unused tty output flags to write messages" 163.It "o1 num unused tty output flags to read login name" 164.It "o2 num unused tty output flags to leave terminal as" 165.It "op bool false terminal uses odd parity" 166.It "os num unused output speed" 167.It "pc str" Ta So Li \e0 Sc Ta 168.No "pad character" 169.It "pe bool false use printer (hard copy) erase algorithm" 170.It "pf num 0 delay" 171between first prompt and following flush (seconds) 172.It "pp str unused PPP authentication program" 173.It "ps bool false line connected to a" 174.Tn MICOM 175port selector 176.It "qu str" Ta So Li \&^\e Sc Ta 177.No "quit character" 178.It "rp str" Ta So Li ^R Sc Ta 179.No "line retype character" 180.It "rw bool false do" 181.Tn NOT 182use raw for input, use cbreak 183.It "sp num unused line speed (input and output)" 184.It "st str" Ta So Li ^T Sc Ta 185.No "status character" 186.It "su str" Ta So Li ^Z Sc Ta 187.No "suspend character" 188.It "tc str none table continuation" 189.It "to num 0 timeout (seconds)" 190.It "tt str" Ta Dv NULL Ta 191.No "terminal type (for environment)" 192.It "ub bool false do unbuffered output (of prompts etc)" 193.It "we str" Ta So Li ^W Sc Ta 194.No "word erase character" 195.It "xc bool false do" 196.Tn NOT 197echo control chars as 198.Ql ^X 199.It "xf str" Ta So Li ^S Sc Ta Dv XOFF 200(stop output) character 201.It "xn str" Ta So Li ^Q Sc Ta Dv XON 202(start output) character 203.El 204.Pp 205The following capabilities are no longer supported by 206.Xr getty 8 : 207.Bl -column Namexx /usr/bin/login Default 208.It "bd num 0 backspace delay" 209.It "cb bool false use crt backspace mode" 210.It "cd num 0 carriage-return delay" 211.It "fd num 0 form-feed (vertical motion) delay" 212.It "nd num 0 newline (line-feed) delay" 213.It "uc bool false terminal is known upper case only" 214.El 215.Pp 216If no line speed is specified, speed will not be altered 217from that which prevails when getty is entered. 218Specifying an input or output speed will override 219line speed for stated direction only. 220.Pp 221Terminal modes to be used for the output of the message, 222for input of the login name, 223and to leave the terminal set as upon completion, 224are derived from the boolean flags specified. 225If the derivation should prove inadequate, 226any (or all) of these three may be overridden 227with one of the 228.Em \&c0 , 229.Em \&c1 , 230.Em \&c2 , 231.Em \&i0 , 232.Em \&i1 , 233.Em \&i2 , 234.Em \&l0 , 235.Em \&l1 , 236.Em \&l2 , 237.Em \&o0 , 238.Em \&o1 , 239or 240.Em \&o2 241numeric specifications, which can be used to specify 242(usually in octal, with a leading '0') 243the exact values of the flags. 244These flags correspond to the termios 245.Em c_cflag , 246.Em c_iflag , 247.Em c_lflag , 248and 249.Em c_oflag 250fields, respectively. 251Each these sets must be completely specified to be effective. 252The 253.Em \&f0 , 254.Em \&f1 , 255and 256.Em \&f2 257are excepted for backwards compatibility with a previous incarnation of 258the TTY sub-system. 259In these flags the bottom 16 bits of the (32 bits) value contain the sgttyb 260.Em sg_flags 261field, while the top 16 bits represent the local mode word. 262.Pp 263Should 264.Xr getty 8 265receive a null character 266(presumed to indicate a line break) 267it will restart using the table indicated by the 268.Em nx 269entry. 270If there is none, it will re-use its original table. 271.Pp 272Delays are specified in milliseconds, the nearest possible 273delay available in the tty driver will be used. 274Should greater certainty be desired, delays 275with values 0, 1, 2, and 3 are interpreted as 276choosing that particular delay algorithm from the driver. 277.Pp 278The 279.Em \&cl 280screen clear string may be preceded by a (decimal) number 281of milliseconds of delay required (a la termcap). 282This delay is simulated by repeated use of the pad character 283.Em \&pc . 284.Pp 285The initial message, and login message, 286.Em \&im 287and 288.Em \&lm 289may include any of the following character sequences, which expand to 290information about the environment in which 291.Xr getty 8 292is running. 293.Pp 294.Bl -tag -width \&%xxx -compact 295.It \&%d 296The current date. 297.It \&%h 298The hostname of the machine, which is normally obtained from the 299system using 300.Xr gethostname 3 , 301but may also be overridden by the 302.Em \&hn 303table entry. 304In either case it may be edited with the 305.Em \&he 306string. 307A '@' in the 308.Em \&he 309string causes one character from the real hostname to 310be copied to the final hostname. 311A '#' in the 312.Em \&he 313string causes the next character of the real hostname 314to be skipped. 315Each character that 316is neither '@' nor '#' is copied into the final hostname. 317Surplus '@' and '#' characters are ignored. 318.It \&%t 319The tty name. 320.It "\&%m, \&%r, \&%s, \&%v" 321The type of machine, release of the operating system, name of the 322operating system, and version of the kernel, respectively, as 323returned by 324.Xr uname 3 . 325.It \&%% 326A 327.Dq % 328character. 329.El 330.Pp 331When getty execs the login process, given 332in the 333.Em \&lo 334string (usually 335.Dq Pa /usr/bin/login ) , 336it will have set 337the environment to include the terminal type, as indicated 338by the 339.Em \&tt 340string (if it exists). 341The 342.Em \&ev 343string, can be used to enter additional data into 344the environment. 345It is a list of comma separated strings, each of which 346will presumably be of the form 347.Em name=value . 348.Pp 349If a non-zero timeout is specified, with 350.Em \&to , 351then getty will exit within the indicated 352number of seconds, either having 353received a login name and passed control 354to 355.Xr login 1 , 356or having received an alarm signal, and exited. 357This may be useful to hangup dial in lines. 358.Pp 359Output from 360.Xr getty 8 361is even parity unless 362.Em \&op 363or 364.Em \&np 365is specified. 366The 367.Em \&op 368string 369may be specified with 370.Em \&ap 371to allow any parity on input, but generate odd parity output. 372Note: this only applies while getty is being run, 373terminal driver limitations prevent a more complete 374implementation. 375.Xr getty 8 376does not check parity of input characters in 377.Dv RAW 378mode. 379.Pp 380If 381.Em \&pp 382string is specified and a Point to Point Protocol 383.Pq Tn PPP 384link bringup sequence is recognized, 385.Xr getty 8 386will invoke the program referenced by the 387.Em \&pp 388string, e.g. 389.Xr pppd 8 . 390This can be used to handle incoming 391.Tn PPP 392calls. 393.Sh SEE ALSO 394.Xr login 1 , 395.Xr gethostname 3 , 396.Xr uname 3 , 397.Xr capfile 5 , 398.Xr ttys 5 , 399.Xr getty 8 , 400.Xr pppd 8 , 401.Xr telnetd 8 402.Sh HISTORY 403The 404.Nm 405file format appeared in 406.Bx 4.2 . 407.Sh BUGS 408The special characters (erase, kill, etc.) are reset to system defaults 409by 410.Xr login 1 . 411In 412.Em all 413cases, '#' or '^H' typed in a login name will be treated as 414an erase character, and '@' will be treated as a kill character. 415.Pp 416The delay stuff is a real crock. 417Apart from its general lack of flexibility, some 418of the delay algorithms are not implemented. 419The terminal driver should support sane delay settings. 420.Pp 421The 422.Em \&he 423capability is stupid. 424