From owner-svn-doc-head@FreeBSD.ORG Wed May 7 18:12:22 2014 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D4CD7A6; Wed, 7 May 2014 18:12:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F47CA9E; Wed, 7 May 2014 18:12:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47ICM3O010441; Wed, 7 May 2014 18:12:22 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47ICMpD010440; Wed, 7 May 2014 18:12:22 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201405071812.s47ICMpD010440@svn.freebsd.org> From: Dru Lavigne Date: Wed, 7 May 2014 18:12:22 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44786 - head/en_US.ISO8859-1/books/handbook/serialcomms X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:12:22 -0000 Author: dru Date: Wed May 7 18:12:21 2014 New Revision: 44786 URL: http://svnweb.freebsd.org/changeset/doc/44786 Log: Finish editorial review of Terminals. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Wed May 7 16:22:52 2014 (r44785) +++ head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Wed May 7 18:12:21 2014 (r44786) @@ -758,171 +758,112 @@ - Configuration + Terminal Configuration This section describes how to configure a &os; system to - enable a login session on a terminal. It assumes that the - kernel is configured to support the serial port to which the + enable a login session on a serial terminal. It assumes that the + system recognizes the serial port to which the terminal is connected and that the terminal is - connected. + connected with the correct cable. - The init process is responsible for all - process control and initialization at system startup. One of - the tasks performed by init is to read - /etc/ttys and start a + In &os;, init reads + /etc/ttys and starts a getty process on the available terminals. The getty process is responsible for reading a login name and starting the login - program. - - To configure terminals for a &os; system, the following - steps should be taken as root: - - - - Add a line to /etc/ttys for the - entry in /dev for the serial port if - it is not already there. - - - - Specify that /usr/libexec/getty - be run on the port, and specify the appropriate - getty type from - /etc/gettytab. - - - - Specify the default terminal type. - - - - Set the port to on. - - - - Specify whether the port should be - secure. - - - - Force init to reread - /etc/ttys. - - - - As an optional step, create a custom - getty type for use in step 2 by - making an entry in /etc/gettytab. For - more information, refer to &man.gettytab.5; and - &man.getty.8;. - - - Adding an Entry to - <filename>/etc/ttys</filename> - - /etc/ttys lists all of the ports - on the &os; system which allow logins. For example, the - first virtual console, ttyv0, has an - entry in this file, allowing logins on the console. This - file also contains entries for the other virtual consoles, - serial ports, and pseudo-ttys. For a hardwired terminal, - list the serial port's /dev entry - without the /dev part. For example, - /dev/ttyv0 would be listed as - ttyv0. - - A default &os; install includes an - /etc/ttys with support for the first - four serial ports: ttyu0 through - ttyu3. When attaching a terminal to - one of those ports, this file does not need to be - edited. - - - Adding Terminal Entries to - <filename>/etc/ttys</filename> - - This example configures two terminals: a Wyse-50 and - an old 286 IBM PC running + program. The ports on the &os; system which allow logins are + listed in /etc/ttys. For example, the + first virtual console, ttyv0, has an + entry in this file, allowing logins on the console. This + file also contains entries for the other virtual consoles, + serial ports, and pseudo-ttys. For a hardwired terminal, + the serial port's /dev entry is listed + without the /dev part. For example, + /dev/ttyv0 is listed as + ttyv0. + + The default + /etc/ttys configures support for the first + four serial ports, ttyu0 through + ttyu3: + + ttyu0 "/usr/libexec/getty std.9600" dialup off secure +ttyu1 "/usr/libexec/getty std.9600" dialup off secure +ttyu2 "/usr/libexec/getty std.9600" dialup off secure +ttyu3 "/usr/libexec/getty std.9600" dialup off secure + + When attaching a terminal to + one of those ports, modify the default entry to set the + required speed and terminal type, to turn the device + on and, if needed, to change the port's + secure setting. If the terminal is + connected to another port, add an entry for the port. + + configures two + terminals in /etc/ttys. The first + entry configures a Wyse-50 + connected to COM2. The second entry + configures an old computer running Procomm terminal software - emulating a VT-100 terminal. The Wyse is connected to the - second serial port and the 286 to the sixth serial port on - a multiport serial card. The corresponding entries in - /etc/ttys would look like - this: + emulating a VT-100 terminal. The computer is connected + to the sixth serial port on + a multi-port serial card. + + + Configuring Terminal Entries ttyu1 "/usr/libexec/getty std.38400" wy50 on insecure ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure - The first field normally specifies the name of - the terminal special file as it is found in - /dev. + The first field specifies the device name of + the serial terminal. - The second field is the command to execute for - this line, which is usually &man.getty.8;. - getty initializes and opens the - line, sets the speed, prompts for a user name, and - then executes &man.login.1;. - - The getty program accepts one - (optional) parameter on its command line, the - getty type. A - getty type configures + The second field tells + getty to initialize and open the + line, set the line speed, prompt for a user name, and + then execute the login program. The optional + getty type configures characteristics on the terminal line, like - bps rate and parity. - getty reads these characteristics - from /etc/gettytab. - - /etc/gettytab contains many - entries for terminal lines, both old and new. In - almost all cases, the entries that start with the - text std will work for hardwired + bps rate and parity. The available + getty types are listed in + /etc/gettytab. In + almost all cases, the getty types that start with + std will work for hardwired terminals as these entries ignore parity. There is a std entry for each - bps rate from 110 to 115200. - &man.gettytab.5; provides more information. - - When setting the getty - type in /etc/ttys, make sure - that the communications settings on the terminal - match. + bps rate from 110 to 115200. Refer to + &man.gettytab.5; for more information. - For this example, the Wyse-50 uses no parity and - connects at 38400 bps. The 286 PC uses no + When setting the getty + type, make sure to match + the communications settings used by the terminal. For + this example, the Wyse-50 uses no parity and + connects at 38400 bps. The computer uses no parity and connects at 19200 bps. - The third field is the type of terminal usually - connected to that terminal line. For dial-up ports, + The third field is the type of terminal. For dial-up ports, unknown or dialup is typically used since users may dial up with practically any type of terminal or software. Since the terminal type does not change for hardwired terminals, a real terminal - type from &man.termcap.5; can be used in this - field. - - For this example, the Wyse-50 uses the real - terminal type while the 286 PC running - Procomm will be set to - emulate at VT-100. + type from /etc/termcap can be specified. + For this example, the Wyse-50 uses the real + terminal type while the computer running + Procomm is set to + emulate a VT-100. The fourth field specifies if the port should be - enabled. If set to on, the - init process will start the program - in the second field, getty. If - this field is set to off, there - will be no getty, and hence no - logins on the port. + enabled. To enable logins on this port, this + field must be set to on. @@ -930,27 +871,18 @@ ttyu5 "/usr/libexec/getty std.19200" port is secure. Marking a port as secure means that it is trusted enough to allow root, or any account - with a UID of 0, to login from that + class="username">root to login from that port. Insecure ports do not allow root logins. On an insecure port, users must login from unprivileged - accounts and then use &man.su.1; or a similar - mechanism to gain superuser privileges. - - It is highly recommended to use - insecure, even for terminals that - are behind locked doors. It is quite easy to login - and use su when superuser - privileges are needed. + accounts and then use su or a similar + mechanism to gain superuser privileges, as described + in . For security reasons, + it is recommended to change this setting to + insecure. - - - - Force <command>init</command> to Reread - <filename>/etc/ttys</filename> After making any changes to /etc/ttys, send a SIGHUP (hangup) @@ -959,18 +891,15 @@ ttyu5 "/usr/libexec/getty std.19200" &prompt.root; kill -HUP 1 - - init is always the first process - run on a system, therefore it will always have a process - ID of 1. - + Since init is always the first process + run on a system, it always has a process + ID of 1. If everything is set up correctly, all cables are in - place, and the terminals are powered up, then a - getty process should be running on each + place, and the terminals are powered up, a + getty process should now be running on each terminal and login prompts should be available on each terminal. - @@ -996,20 +925,16 @@ ttyu5 "/usr/libexec/getty std.19200" controls are turned up. If it is a printing terminal, make sure paper and ink are in good supply. - Make sure that a getty process is - running and serving the terminal. For example, to get a list - of running getty processes with - ps, type: - - &prompt.root; ps -axww|grep getty - - There should be an entry for the terminal. For example, - the following display shows that a getty is + Use ps to make sure that a + getty process is + running and serving the terminal. For example, + the following listing shows that a getty is running on the second serial port, ttyu1, and is using the std.38400 entry in /etc/gettytab: - 22189 d1 Is+ 0:00.03 /usr/libexec/getty std.38400 ttyu1 + &prompt.root; ps -axww|grep ttyu +22189 d1 Is+ 0:00.03 /usr/libexec/getty std.38400 ttyu1 If no getty process is running, make sure the port is enabled in /etc/ttys.