Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getty(1M) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ct(1C)

init(1M)

login(1)

ioctl(2)

gettydefs(4)

inittab(4)

tty(7)

getty(1M)

NAME

getty − set terminal type, modes, speed, and line discipline

SYNOPSIS

/etc/getty [ −h ] [ −t timeout ] line [ speed [ type [ linedisc ] ] ]
/etc/getty −c file

DESCRIPTION

getty is a program that is invoked by init(1M).  It is the second process in the series, (init-getty-login-shell) that ultimately connects a user with the UNIX system.  Initially getty generates a system identification message from the values returned by the uname(2) system call.  Then, if /etc/issue exists, it outputs this to the user’s terminal, followed finally by the login message field for the entry it is using from /etc/gettydefs.  getty reads the user’s login name and invokes the login(1) command with the user’s name as argument.  While reading the name, getty attempts to adapt the system to the speed and type of terminal being used. 

Line is the name of a tty line in /dev to which getty is to attach itself.  getty uses this string as the name of a file in the /dev directory to open for reading and writing.  Unless getty is invoked with the −h flag, getty will force a hangup on the line by setting the speed to zero before setting the speed to the default or specified speed.  The −t flag plus timeout in seconds, specifies that getty should exit if the open on the line succeeds and no one types anything in the specified number of seconds.  Because of imposed timing and process respawning limitations in init(1M), the value of timeout may be in the range 12 <= timeout <= max value of an integer.  A value less than 12 will result in init(1M) attempting to respawn a new getty process too rapidly on the port, and eventually causing the port to become inactive until the user enters either the /etc/init q, /etc/init Q, or /sbin/telinit Q command.  The optional second argument, speed, is a label to a speed and tty definition in the file /etc/gettydefs.  This definition tells getty at what speed to initially run, what the login message should look like, what the initial tty settings are, and what speed to try next should the user indicate that the speed is inappropriate (by typing a <break> character).  The default speed is 300 baud.  The optional third argument, type, is a character string describing to getty what type of terminal is connected to the line in question.  getty understands the following types:

nonedefault
hp45Hewlett-Packard HP45
c100Concept 100

The default terminal is none; i.e., any crt or normal terminal unknown to the system.  Also, for terminal type to have any meaning, the virtual terminal handlers must be compiled into the operating system.  They are available, but not compiled in the default condition.  The optional fourth argument, linedisc, is a character string describing which line discipline to use in communicating with the terminal. Again the hooks for line disciplines are available in the operating system but there is only one presently available, the default line discipline, LDISC0. 

When given no optional arguments, getty sets the speed of the interface to 300 baud, specifies that raw mode is to be used (awaken on every character), that echo is to be suppressed, either parity allowed, new-line characters will be converted to carriage return-line feed, and tab expansion performed on the standard output.  It types the login message before reading the user’s name a character at a time.  If a null character (or framing error) is received, it is assumed to be the result of the user pushing the “break” key.  This will cause getty to attempt the next speed in the series.  The series that getty tries is determined by what it finds in /etc/gettydefs. 

The user’s name is terminated by a new-line or carriage-return character.  The latter results in the system being set to treat carriage returns appropriately (see ioctl(2)). 

The user’s name is scanned to see if it contains any lower-case alphabetic characters; if not, and if the name is non-empty, the system is told to map any future upper-case characters into the corresponding lower-case characters. 

In addition to the standard UNIX system erase and kill characters (# and @), getty also understands \b and ^U.  If the user uses a \b as an erase, or ^U as a kill character, getty sets the standard erase character and/or kill character to match. 

getty also understands the “standard” ESS2 protocols for erasing, killing and aborting a line, and terminating a line.  If getty sees the ESS erase character, _, or kill character, $, or abort character, &, or the ESS line terminators, / or !, it arranges for this set of characters to be used for these functions. 

Finally, login is called with the user’s name as an argument.  Additional arguments may be typed after the login name.  These are passed to login, which will place them in the environment (see login(1)). 

A check option is provided.  When getty is invoked with the −c option and file, it scans the file as if it were scanning /etc/gettydefs and prints out the results to the standard output.  If there are any unrecognized modes or improperly constructed entries, it reports these.  If the entries are correct, it prints out the values of the various flags.  See ioctl(2) to interpret the values.  Note that some values are added to the flags automatically. 

SECURITY FEATURES

The following security features are in effect on systems running CX/SX. 

Getty(1M) insures that no background processes have the tty port open before it issues the "login" prompt.  If any such processes are found, they are killed with the SIGKILL signal.  (SIGKILL signals cannot be caught.  They are a "sure kill".)  A message is printed on the console listing the process number and user id for each such process killed. 

Trusted path -- The user can assure him/herself that he/she is talking to a getty and not a login "Trojan horse" by following this simple procedure.  Make sure the "On Line" light on a terminal goes off, then comes back on, followed by the "login:" prompt.  This can be achieved by pressing the "DISCON" (disconnect) key on your terminal if your terminal is hardwired, or by hanging up and redialing, if you are using a modem. 

The getty command will ensure that the video RAM of all Wyse 150 terminals that are connected to the system will be erased under a CX/SX B2 system.  If /etc/ttytype has "wyse150" defined as the tty type for the particular line, then the video RAM and screen will be cleared and the message

Wyse 150 video RAM has been cleared for security purposes. 

will be displayed on the screen. 

SYS_NAME FEATURE

getty, as distributed with standard Unix, is compiled with the SYS_NAME feature disabled.  The SYS_NAME feature is enabled for CX/SX, causing the login prompt to include the name of the system.  This is useful in network environments as a confirmation as to which system has been reached.  In addition, the contents of the /etc/issue file, if it exists, is displayed on the terminal between the system name and the word "login:".  This file can be used to further customize the login sequence, provide login help information, or provide pre-login news. 

FILES

/etc/gettydefs
/etc/issue
/etc/ttytype

SEE ALSO

ct(1C), init(1M), login(1), ioctl(2), gettydefs(4), inittab(4), tty(7). 

BUGS

While getty does understand simple single character quoting conventions, it is not possible to quote the special control characters that getty uses to determine when the end of the line has been reached, which protocol is being used, and what the erase character is.  Therefore it is not possible to login via getty and type a #, @, /, !, _, backspace, ^U, ^D, or & as part of your login name or arguments.  They will always be interpreted as having their special meaning as described above. 

The secured getty is much slower than the standard getty.  A variant of the fuser(1M) algorithm is used to check for offending processes.  This is where most of the time is spent. 

Note: as always, the security analysis above assumes the network between the terminal and the host can be trusted. 

CX/UX Administrator’s Reference

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026