The text of a manual · part 28 of 49
Cyclades-TS User Guide: Chapter 3 - Additional Features, pages 267 to 276
Pages 267 to 276 of 454, from Cyclades-TS User Guide
The original document is the PDF (4.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Cyclades TS2000 and Avocent TS2000
Page 267
Chapter 3 - Additional Features TS110-only Analog and Digital Ports Digital Ports The digital ports are dry contact inputs. They are controlled via /dev/gpio, which provides 8 bit status of the 8 digital ports. The LSB of the status byte is digital port 1. When pin+ and pinfrom the digital port are open (no contact between them), the port’s bit on the status byte is 0. If pin+ and pin- are closed, the port’s bit on the status byte is 1.
Analog Ports The analog ports are accessed via /dev/adc1 and /dev/adc2. Each device controls a 15-bit Analog-to-Digital converter, which returns the digital value of the voltage between pin+ and pin- on the analog port. The Analog-to-Digital converter reports full scales (0x7FFF), when pin+ and pin- are open (no contact between them). If pin+ and pin- are closed, the Analog-toDigital converter reports zero (0x0000). When applying 10 K ohms over pin+ and pin-, the Analog-to-Digital converter reports half scale (around 0x4000).
Port Utility (/bin/pu) Port Utility is the native application to access the digital and analog ports. Here are some commands: a) For general help: [TS110/]# pu -h Usage: pu -<r> [-d device] [-p digital_port] -l -o -h Options: -r read from device.
-d device defines device to use.
-p digital_port defines digital port [1-8] to use.
-l list digital port status.
-o output in decimal format.
User Guide
267
Page 268
TS110-only Analog and Digital Ports -h for help.
b) Check digital ports. On this example, digital port 1, 2 and 3 are closed. The command returns the status byte for all digital ports. [TS110]# pu -r -d /dev/gpio 07 c) Check digital ports as previously, but now with –l option. This option lists all ports and their status. On this example, digital port 1, 2 and 3 are closed. [TS110]# pu -r -d /dev/gpio -l Digital Port Status: 07 port 1 - closed port 2 - closed port 3 - closed port 4 - open port 5 - open port 6 - open port 7 - open port 8 - open d) It is also possible to check just one digital port at a time. For that, the port number must be passed along with the parameter –p. For verbal report, use option –l. On this example, digital port 3 is closed. [TS110]# pu -r -d /dev/gpio -p 3 -l Digital Port Status: port 3 - closed
268
Cyclades-TS
Page 269
Chapter 3 - Additional Features [TS110]# pu -r -d /dev/gpio -p 3 1 e) On the previous command, if port is open, the command return 0. [TS110]# pu -r -d /dev/gpio -p 3 0 f) Analog Port 1 is open. Reading full scale. [TS110]# pu -r -d /dev/adc1 7fff
Analog and Digital ports on the Web The analog port values and the digital port status are also available via web browser on Information Section.
Sending Warning Messages TS110 can respond to events or status change by sending warning messages to the console port or e-mail messages via sendmail. The /etc/io_cron.src file and its /etc/io_cron.sh shell file are cron files that can be included in the /etc/crontab_files, as described on the crond utility configuration section. The /etc/io_counter file is automatically created by /etc/io_cron.sh when it runs by the first time. The /etc/io_counter file holds the countdown counters with the number of messages per event. These counters limit the number of warning messages issued per event. Whenever a counter reaches zero, no further message is generated for that event. Value -1 means no limit. To restart any counter, either change the counter value in the file or remove the file itself, which forces all counters to their default values when the file is created again.
User Guide
269
Page 270
TS110-only Analog and Digital Ports The /etc/io_cron.sh file has the counter default values that will be used to create the /etc/ io_counter file. The counter default values, which can be modified by the user, are as follows: ADC1=2 #Number of times Analog Port 1 warning will be sent ADC2=2 #Number of times Analog Port 2 warning will be sent DIG1=2 #Number of times Digital Port 1 warning will be sent DIG2=2 #Number of times Digital Port 2 warning will be sent DIG3=2 #Number of times Digital Port 3 warning will be sent DIG4=2 #Number of times Digital Port 4 warning will be sent DIG5=2 #Number of times Digital Port 5 warning will be sent DIG6=2 #Number of times Digital Port 6 warning will be sent DIG7=2 #Number of times Digital Port 7 warning will be sent DIG8=2 #Number of times Digital Port 8 warning will be sent
The same /etc/io_cron.sh file also has the trigger values for each event and status. These values, which can be customized by the user, are as follows: H_ADC1=65535
# Analog Port 1 A/D Converter high limit
L_ADC1=0
# Analog Port 1 A/D Converter low limit
H_ADC2=65535
# Analog Port 2 A/D Converter high limit
L_ADC2=0
# Analog Port 2 A/D Converter low limit
D1=0
# Digital Port 1 status (1-closed, 0-open)
D2=0
# Digital Port 2 status (1-closed, 0-open)
D3=0
# Digital Port 3 status (1-closed, 0-open)
D4=0
# Digital Port 4 status (1-closed, 0-open)
D5=0
# Digital Port 5 status (1-closed, 0-open)
D6=0
# Digital Port 6 status (1-closed, 0-open)
270
Cyclades-TS
Page 271
Chapter 3 - Additional Features D7=0
# Digital Port 7 status (1-closed, 0-open)
D8=0
# Digital Port 8 status (1-closed, 0-open)
Therefore, if at any time, digital port 5 changes status, becoming different to the initial one defined on D5, a warning message is sent out. In order to save any change done on these files, do not forget to include the file names in /etc/config_files and run saveconf.
User Guide
271
Page 272
Linux-PAM Linux-PAM Linux-PAM (Pluggable Authentication Modules for Linux) is a suite of shared libraries that enable the local system administrator to choose how applications authenticate users. In other words, without (rewriting and) recompiling a PAM-aware application, it is possible to switch between the authentication mechanism(s) it uses. Indeed, one may entirely upgrade the local authentication system without touching the applications themselves. It is the purpose of the Linux-PAM project to separate the development of privilege-granting software from the development of secure and appropriate authentication schemes. This is accomplished by providing a library of functions that an application may use to request that a user be authenticated. This PAM library is configured locally with a system file, /etc/pam.conf to authenticate a user request via the locally available authentication modules. The modules themselves will usually be located in the directory /lib/security and take the form of dynamically loadable object files. The Linux-PAM authentication mechanism gives to the system administrator the freedom to stipulate which authentication scheme is to be used. S/he has the freedom to set the scheme for any/all PAM-aware applications on your Linux system. That is, s/he can authenticate from anything as generous as simple trust (pam_permit) to something as severe as a combination of a retinal scan, a voice print and a one-time password! Linux-PAM deals with four separate types of (management) task. These are: authentication management, account management, session management, and password management. The association of the preferred management scheme with the behavior of an application is made with entries in the relevant Linux-PAM configuration file. The management functions are performed by modules specified in the configuration file. Following is a figure that describes the overall organization of Linux-PAM:
272
Cyclades-TS
Page 273
Chapter 3 - Additional Features
Figure 32: Data flow diagram of Linux-PAM
The left of the figure represents the application: Application X. Such an application interfaces with the Linux-PAM library and knows none of the specifics of its configured authentication method. The Linux-PAM library (in the center) consults the contents of the PAM configuration file and loads the modules that are appropriate for Application X. These modules fall into one of four management groups (lower center) and are stacked in the order they appear in the configuration file. These modules, when called by Linux-PAM, perform the various authentication tasks for the application. Textual information, required from or offered to the user can be exchanged through the use of the application-supplied conversation function.
User Guide
273
Page 274
Linux-PAM The Linux-PAM Configuration File Linux-PAM is designed to provide the system administrator with a great deal of flexibility in configuring the privilege-granting applications of their system. The local configuration of those aspects of system security controlled by Linux-PAM is contained in a single system file /etc/pam.conf. In this section we discuss the correct syntax of and generic options respected by entries to these files.
Configuration File Syntax The reader should note that the Linux-PAM-specific tokens in this file are case-insensitive. The module paths, however, are case-sensitive since they indicate a file’s name and reflect the case-dependence of typical Linux file systems. The case-sensitivity of the arguments to any given module is defined for each module in turn. In addition to the lines described below, there are two special characters provided for the convenience of the system administrator: #
Comments are preceded by this character and extend to the next end-of-line.
\
This character extends the configuration lines.
A general configuration line of the /etc/pam.conf file has the following form: Service-name module-type control-flag module-path arguments The meaning of each of these tokens is explained below. Service-name
The name of the service associated with this entry. Frequently the service name is the conventional name of the given application. For example, ‘ftpd’, ‘rlogind’, ‘su’, etc. There is a special service-name, reserved for defining a default authentication mechanism. It has the name ‘OTHER’ and may be specified in either lower or upper case characters. Note, when there is a module specified for a named service, the ‘OTHER’ entries are ignored.
Module-type
One of (currently) the four types of module. The four types are as follows:
274
Cyclades-TS
Page 275
Chapter 3 - Additional Features Auth- This module type provides two aspects of authenticating the user. First, it establishes that the user is who they claim to be, by instructing the application to prompt the user for a password or other means of identification. Second, the module can grant group membership, independently of the /etc/groups, or other privileges through its credential-granting properties. Account- This module performs non-authentication-based account management. It is typically used to restrict or permit access to a service based on the time of day, currently available system resources (maximum number of users) or perhaps the location of the applicant user - ‘root’ login only on the console. Session- Primarily, this module is associated with doing things that need to be done for the user before or after they can be given service. Such things include the logging of information concerning the opening or closing of some data exchange with a user, mounting directories, etc. Password- This last module type is required for updating the authentication token associated with the user. Typically, there is one module for each ‘challenge/response’ based authentication (auth) module-type. Control-flag
The control-flag is used to indicate how the PAM library will react to the success or failure of the module it is associated with. Since modules can be stacked (modules of the same type execute in series, one after another), the control-flags determine the relative importance of each module. The application is not made aware of the individual success or failure of modules listed in the ‘/etc/pam.conf’ file. Instead, it receives a summary of success or fail responses from the Linux-PAM library. The order of execution of these modules is that of the entries in the /etc/pam.conf file: earlier entries are executed before later ones. The control-flag can be defined with one of two syntaxes. The simpler (and historical) syntax for the control-flag is a single keyword defined to indicate the severity of concern associated with the success or failure of a specific module. There are four such keywords: required, requisite, sufficient and optional.
The Linux-PAM library interprets these keywords in the following manner:
User Guide
275
Page 276
Linux-PAM
Required
This indicates that the success of the module is required for the moduletype facility to succeed. Failure of this module will not be apparent to the user until all of the remaining modules (of the same module-type) have been executed.
Requisite
This is similar to required. However, in the case that such a module returns a failure, control is directly returned to the application. The return value is that associated with the first required or requisite module to fail. Note that this flag can be used to protect against the possibility of a user getting the opportunity to enter a password over an unsafe medium. It is conceivable that such behavior might inform an attacker of valid accounts on a system. This possibility should be weighed against the significant concerns of exposing a sensitive password in a hostile environment.
Sufficient
The success of this module is deemed ‘sufficient’ to satisfy the LinuxPAM library that this moduletype has succeeded in its purpose. In the event that no previous required module has failed, no more ‘stacked’ modules of this type are invoked. (Note: in this case subsequent required modules are not invoked.) A failure of this module is not deemed as fatal to satisfying the application.
Optional
As its name suggests, this control-flag marks the module as not being critical to the success or failure of the user’s application for service. In general, Linux-PAM ignores such a module when determining if the module stack will succeed or fail. However, in the absence of any definite successes or failures of previous or subsequent stacked modules this module will determine the nature of the response to the application. One example of this latter case is when the other modules return something like PAM_IGNORE.
Module Path Module Path is the path-name of the dynamically loadable object file--the pluggable module itself. If the first character of the module path is ‘/’, it is assumed to be a complete path. If this is not the case, the given module path is appended to the default module path: /lib/security. Currently, the Cyclades-TS has the following modules available:
276
Cyclades-TS