|
| 以 PDF 格式下载本书
UUCP Databases and Programs
12
- The UNIX-to-UNIX Copy Program (UUCP) enables computers to transfer files and exchange mail with each other. It also enables computers to participate in large networks such as Usenet.
- The Solaris environment provides the Basic Network Utilities (BNU) version of UUCP, also known as HoneyDanBer UUCP. The term UUCP denotes the complete range of files and utilities that comprise the system, of which the program uucp is only a part. The UUCP utilities range from those used to copy files between computers (uucp and uuto) to those used for remote login and command execution (cu and uux)..
-
- This chapter introduces the UUCP programs and daemons. It then provides complete information for setting up the UUCP database files as part of UUCP configuration. Chapter 13, "Configuring and Maintaining UUCP," explains how to configure UUCP after the databases have been created.
UUCP Hardware Configurations
- UUCP supports the following hardware configurations:
-
-
Direct links-You can create a direct link to another computer by running RS- 232 cables between serial ports on the two machines. Direct links are useful where two computers communicate regularly and are physically close--within 50 feet of each other. You can use a limited distance-modem to increase this distance somewhat.
-
Telephone lines-Using an automatic call unit (ACU) such as a high-speed modem, your machine can communicate with other computers over standard phone lines. The modem dials the telephone number requested by UUCP. The recipient machine must have a modem capable of answering incoming calls.
-
Network-UUCP can also communicate over a network running TCP/IP or other protocol family. Once your computer is established as a host on a network, it can contact any other host connected to the network.
- This chapter assumes that your UUCP hardware has already been assembled and configured. If you need to set up a modem, refer to Peripherals Administration and the manuals that came with the modem for assistance.
Software Comprising UUCP
- The UUCP software is automatically included when you run the Solaris installation program and select the entire distribution. The UUCP programs can be divided into three categories: daemons, administrative programs, and user programs.
Daemons
- The UUCP system has four daemons: uucico, uuxqt, uusched and in.uucpd. These daemons handle UUCP file transfers and command executions. You can also run them manually from the shell.
-
-
uucico-Selects the device used for the link, establishes the link to the remote computer, performs the required login sequence and permission checks, transfers data and execute files, logs results, and notifies the user by
-
mail of transfer completions. uucico acts as the "login shell" for UUCP login accounts. When the local uucico daemon calls a remote machine, it communicates directly with the remote uucico daemon during the session.
-
uucp, uuto, and uux programs execute the uucico daemon after all the required files have been created, to contact the remote computer. uusched and Uutry all execute uucico. (See the uucico(1M) man page for details.)
-
-
uuxqt-Executes remote execution requests. It searches the spool directory for execute files (always named X.file) that have been sent from a remote computer. When an X.file file is found, uuxqt opens it to get the list of data files that are required for the execution. It then checks to see if the required data files are available and accessible. If the files are available, uuxqt checks the Permissions file to verify that it has permission to execute the requested command. The uuxqt daemon is executed by the uudemon.hour shell script, which is started by cron. (See the uuxqt(1M) man page for details.)
-
uusched-Schedules the queued work in the spool directory. uusched is initially run at boot time by the uudemon.hour shell script, which is started by cron. (See the uusched(1M) man page for details.) Before starting the uucico daemon, uusched randomizes the order in which remote computers will be called.
-
in.uucpd-Supports UUCP connections over networks. The inetd on the remote host invokes in.uucpd whenever a UUCP connection is established. uucpd then prompts for a login name. uucico on the calling host must respond with a login name. in.uucpd will then prompt for a password, unless one is not required. (See the in.uucpd(1M) man page for details.)
Administrative Programs
- Most UUCP administrative programs are in /usr/lib/uucp. Most basic database files are in /etc/uucp. The only exception is uulog, which is in /usr/bin. The home directory of the uucp login ID is /var/spool/uucppublic. When running the administrative programs through cu or login, use the uucp user ID. It owns the programs and spooled data files.
-
User Programs
- The UUCP user programs are in /usr/bin. You do not need special permission to use these programs.
-
-
cu-Connects your machine to a remote computer so that you can log in on both at the same time. cu enables you to transfer files or execute commands on either machine without dropping the initial link. (See the cu(1C) man page for details.)
-
uucp-Lets you copy a file from one machine to another. It creates work files and data files, queues the job for transfer, and calls the uucico daemon, which in turn attempts to contact the remote computer. (See the uucp(1C) man page for details.)
-
uuto- Copies files from the local machine to the public spool directory /var/spool/uucppublic/receive on the remote machine. Unlike uucp, which lets you copy a file to any accessible directory on the remote machine, uuto places the file in an appropriate spool directory and tells the remote user to pick it up with uupick. (See the uuto(1C) man page for details.)
-
uupick-Retrieves files in /var/spool/uucppublic/receive when files are transferred to a computer using uuto. (See the uuto(1C) man page.)
-
-
uux-Creates the work, data, and execute files needed to execute commands on a remote machine. (See the uux(1C) man page for details.)
-
uustat-Displays the status of requested transfers (uucp, uuto, or uux). It also provides a means of controlling queued transfers. (See the uustat(1C) man page for details.)
- Note that typically you use uuto, uupick, and uux programs only for debugging.
Introducing the UUCP Database Files
- A major part of UUCP setup is the configuration of the files comprising the UUCP database. These files are in the /etc/uucp directory. You need to edit them to set up UUCP or PPP on your machine. The files include:
-
-
Config-Contains a list of variable parameters. You can manually set these parameters to configure the network.
-
Devconfig-Used to configure network communications.
-
Devices-Contains information concerning the location and line speed of automatic call unit (modem), direct links, and network devices. It is used by PPP as well as UUCP
-
Dialers-Contains character strings required to negotiate with modems to establish connections with remote computers. It is used by PPP as well as UUCP
-
Dialcodes-Contains dial-code abbreviations that may be used in the phone number field of Systems file entries. Though not required, it can be used by PPP as well as UUCP.
-
Grades- Defines job grades, and the permissions associated with each job grade, that users may specify to queue jobs to a remote computer.
-
Limits-Defines the maximum number of simultaneous uucicos, uuxqts, and uuscheds permitted on your machine.
-
Permissions-Defines the level of access granted to remote hosts that attempt to transfer files or execute commands on your machine.
-
Poll-Defines machines that are to be polled by your system and when they are polled.
-
-
Sysfiles-Assigns different or multiple files to be used by uucico and cu as Systems, Devices, and Dialers files.
-
Sysname-Enables you to define a unique UUCP name for a machine in addition to its TCP/IP host name.
-
Systems-Contains information needed by the uucico daemon, cu, and PPP to establish a link to a remote computer. This information includes the name of the remote host, the name of the connecting device associated with the remote host, time when the host can be reached, telephone number, login ID, and password.
- Several other files may be considered part of the supporting database but are not directly involved in establishing a link and transferring files.
Configuring UUCP Files
- The UUCP database consists of the files shown in "Introducing the UUCP Database Files". However, basic UUCP configuration involves only the following critical files:
-
-
/etc/uucp/Systems
-
/etc/uucp/Devices
-
/etc/uucp/Dialers
- Because PPP uses some of the UUCP databases, you should understand at least these critical database if you plan to configure PPP. Once these databases are configured, UUCP administration is fairly straightforward.Typically, you edit the Systems file first, and then edit the Devices file. You usually can use the default /etc/uucp/Dialers file, unless you plan to add dialers that aren't in the default. In addition, you may also want to use the following files for basic UUCP and PPP configuration:
-
-
/etc/uucp/Sysfiles
-
/etc/uucp/Dialcodes
-
/etc/uucp/Sysname
- Because these files work closely with each other, you should understand the contents of them all before you change any of them. A change to an entry in one file may require a change to a related entry in another file. The remaining files listed in "Introducing the UUCP Database Files" on page 181 are not as critically intertwined.
-
Note - PPP uses only the files described in this section. It does not use the other UUCP database files.
- The remaining sections of this chapter explain the UUCP databases in detail.
/etc/uucp/Systems File
- The /etc/uucp/Systems file contains the information needed by the uucico daemon to establish a communication link to a remote computer. It is the first file you need to edit to configure UUCP.
- Each entry in the Systems file represents a remote computer that your host calls. A particular host may have more than one entry. The additional entries represent alternative communication paths that will be tried in sequential order. In addition, by default UUCP prevents any computer that does not appear in /etc/uucp/Systems from logging in to your host.
- Using the Sysfiles file, you can define several files to be used as Systems files. See the description of the Sysfiles file for details.
- Each entry in the Systems file has the following format:
-
System-Name Time Type
-
Speed Phone
-
Chat Script
- Here is an example showing the fields of the Systems file.
-
Table 12-1
System-
Name | Tim
e |
Type |
Speed |
Phone |
Chat Script |
| arabian | Any | ACUE
C | 3840
0 | 111222
2 | ogin: Puucp ssword:beledi |
System-Name Field
- This field contains the node name of the remote computer. On TCP/IP networks, this may be the machine's host name or a name created specifically for UUCP communications through the /etc/uucp/Sysname file. See "/etc/uucp/Sysname File" on page 206. In Table 12-2 on page 184, the System-Name field contains an entry for remote host arabian.
Time Field
- This field specifies the day-of-week and time-of-day when the remote computer can be called.The format of the Time field is:
-
-
daytime[;retry]
- The day portion may be a list containing some of the following entries:
-
Table 12-2
| Su Mo Tu We Th Fr Sa | For individual days |
| Wk | For any weekday |
| Any | For any day |
| Never | Your host will never initiate a call to the remote computer; the call must be initiated by the remote computer. Your host is then operating in passive mode. |
-
Table 12-2 on page 184 shows Any in the Time field, indicating that host arabian can be called at any time.
- The time portion should be a range of times specified in 24-hour notation. (For example: 0800-1230 for 8:30 a.m. to 12:30 p.m.) If no time portion is specified, any time of day is assumed to be allowed for the call.
- A time range that spans 0000 is permitted. For example, 0800-0600 means all times are allowed other than times between 6 a.m. and 8 a.m.
Retry Subfield
- The Retry subfield enables you to specify the minimum time (in minutes) before a retry, following a failed attempt. The default wait is 60 minutes. The subfield separator is a semicolon (;). For example, Any;9 is interpreted as call any time, but wait at least 9 minutes before retrying after a failure occurs.
- If you do not specify a ;retry entry, an exponential back off algorithm is used. What this means is that UUCP will start with a default wait time that grows larger as the number of failed attempts increases. For example, suppose the initial retry time is 5 minutes. If there is no response, the next retry will be 10 minutes later. The next retry will be 20 minutes later, and so on until the maximum retry time of 23 hours is reached. If ;retry is specified, that will always be the retry time. Otherwise, the back off algorithm is used.
Type Field
- This field contains the device type that should be used to establish the communication link to the remote computer. The keyword used in this field is matched against the first field of Devices file entries as shown in Table 12-3. (Note that the fields listed in the table heading are for the Systems file and do not apply to the Devices file. For a table showing the same correspondences to fields in the Devices file, see Table 12-8 on page 193.)
-
Table 12-3 /etc/uucp/Devices
File Name |
System-Name
Field |
Time
Field |
Type
Field | Spee
d
Field |
Phone
Field |
Chat Script
Field |
| Systems | arabian | Any | ACUEC, g | 38400 | 1112222 | ogin: Puucp ssword:beledi. |
| Devices | ACUEC | cua/
a | - | 38400 | usrv32bis-
ec |
- You can define the protocol used to contact the system by adding it on to the Type field. The example above shows how to attach the protocol g to the device type ACUEC. (For information on protocols, see "Protocol Definitions in the Devices File" on page 197.)
Speed Field
- This field (also known as the Class Field) specifies the transfer speed of the device used in establishing the communication link. It may contain a letter and speed (for example, C1200, D1200) to differentiate between classes of dialers (refer to "Class Field" on page 193).
- Some devices can be used at any speed, so the keyword Any may be used. This field must match the Class field in the associated Devices file entry as shown in Table 12-4:
-
Table 12-4 /etc/uucp/Devices
File Name | System-
Name
Field |
Time
Field |
Type
Field |
Speed
Field |
Phone
Field |
Chat Script
Field |
| Systems | eagle | Any | ACU, g | D1200 | NY3251 | ogin: nuucp ssword: Oakgrass |
| Devices | ACU | tty11 | -- | D1200 | penril |
- If information is not required for this field, use a dash (-) as a place holder for the field.
Phone Field
- This field allows you to specify the telephone number (token) of the remote computer for automatic dialers (port selectors). The telephone number consists of an optional alphabetic abbreviation and a numeric part. If an abbreviation is used, it must be one that is listed in the Dialcodes file, as shown in Table 12-7:
-
Table 12-5
| Systems file: | nubian Any ACU 2400 NY5551212 ogin: Puucp ssword: Passuan |
| Dialcodes file: | NY 1=212 |
- In this string, an equals sign (=) tells the ACU to wait for a secondary dial tone before dialing the remaining digits. A dash (-) in the string instructs the ACU to pause 4 seconds before dialing the next digit.
- If your computer is connected to a port selector, you may access other computers connected to that selector. The Systems file entries for these remote machines should not have a telephone number in the Phone field. Instead, this field should contain the token to be passed on to the switch. In this way, the port selector will know the remote machine with which your host wishes to communicate. (This is usually just the system name.) The associated Devices file entry should have a \D at the end of the entry to ensure that this field is not translated using the Dialcodes file.
Chat Script Field
- This field (also called the Login field) contains a string of characters called a chat script. The chat script contains the characters the local and remote machines must pass to each other in their initial conversation. Chat scripts have the format:
-
expect send [expect send] ....
-
expect represents the string that the local host expects to get from the remote host to initiate conversation. send is the string the local host will send after it receives the expect string from the remote host. A chat script can have more than one expect send sequence.
- A basic chat script might contain:
-
- Login prompt that the local host expects to get from the remote machine.
- Login name that the local host will send to the remote machine in order to log in.
- Password prompt that the local host expects to get from the remote machine.
- Password that the local host will send to the remote machine.
- The expect field may be made up of subfields of the form:
- expect[-send-expect]...
- where the send is sent if the prior expect is not successfully read, and the expect following the send is the next expected string.
- For example, with strings login--login, the UUCP on the local host will expect login. If UUCP gets login from the remote machine, it will go on to the next field. If it does not get login, it will send a carriage return, then look for login again. If the local computer initially does not expect any characters, use the characters "" (null string) in the expect field. Note that all send fields will be sent followed by a carriage return unless the send string is terminated with a \c.
- Here is an example of a Systems file entry that uses an expect-send string:
-
sonora Any ACUEC 9600 2223333 "" \r \r ogin:-BREAK-ogin: Puucpx ssword: xyzzy
|
- This example tells UUCP on the local host to send two carriage returns and wait for ogin: (for Login:). If you don't get ogin:, send a BREAK. When you do get ogin: send the login name Puucpx. When you get ssword: (for Password:), send the password xyzzy.
-
Table 12-6 lists some useful escape characters.
-
Table 12-6 Systems
| \b | Send or expect a backspace character |
| \c | If at the end of a string, suppress the carriage return that is normally sent. Ignored otherwise |
| \d | Delay 1-3 seconds before sending more characters |
| \E | Start echo checking. (From this point on, whenever a character is transmitted, it will wait for the character to be received before doing anything else.) |
| \e | Echo check off |
| \H | Ignore one hangup. Use this option for dialback modems |
| \K | Send a BREAK character |
| \M | Turn on CLOCAL flag |
| \m | Turn off CLOCAL flag |
| \n | Send or expect a newline character |
| \N | Send a null character (ASCII NUL) |
| \p | Pause for approximately 1/4 to 1/2 second |
| \r | Send or expect a carriage return |
| \s | Send or expect a space character |
| \t | Send or expect a tab character |
| EOT | Send an EOT followed by newline twice |
| BREAK | Send a BREAK character |
| \ddd | Send or expect the character represented by the octal digits (ddd) |
Enabling Dialback Through the Chat Script
- Some companies set up dial-in servers to handle calls from remote computers. For example, your company might have a dial-in server with a dialback modem that employees can call from their home computers. After the dial-in server identifies the remote machine, it disconnects the link to the remote machine and then calls the remote machine back. The communications link is then reestablished.
- You can facilitate dialback by using the \H option in the Systems file chat script at the place where dialback should occur. Include the \H as part of an expect string at the place where the dial-in server is expected to hang up.
- For example, suppose the chat script that calls a dial-in server contains the following string:
-
- The UUCP dialing facility on the local machine expects to get the characters INITIATED from the dial-in server. After the INITIATED characters have been matched, the dialing facility flushes any subsequent characters it receives until the dial-in server hangs up. The local dialing facility then waits until it receives the next part of the expect string, the characters ogin:, from the dial-in server. When it receives the ogin:, the dialing facility then continues through the chat script.
- You need not have a string of characters directly preceding or following the \H, as shown in the sample string above.
Hardware Flow Control
- You can also use the pseudo-send STTY=value string to set modem characteristics. For instance, STTY=crtscts enables hardware flow control.
-
STTY accepts all stty modes. See the stty(1V) and termio(4) man pages for complete details.
- The following example would enable hardware flow control in a Systems file entry:
-
unix Any ACU 2400 12015551212 "" \r login:-\r-login:-\r-login: nuucp password: xxx "" \
STTY=crtscts
|
- This pseudo-send string can also be used in entries in the Dialers file.
Setting Parity
- In some cases, you will have to reset the parity because the system that you are calling checks port parity and drops the line if it is wrong. The expect-send couplet "" P_ZERO sets the high order bit (parity bit) to 0. For example:
-
unix Any ACU 2400 12015551212 "" P_ZERO "" \r login:-\r-login:-\r-login: nuucp password: xxx
|
- In the same manner, P_EVEN sets parity to even (the default), P_ODD sets odd parity, and P_ONE sets the parity bit to 1.
- The parity couplet can be inserted anywhere in the chat script. It applies to all information in the chat script following the "" P_ZERO. It can also be used in entries in the Dialers file.
/etc/uucp/Devices File
- The /etc/uucp/Devices file contains information for all the devices that may be used to establish a link to a remote computer. These devices include ACUs--which includes modern, high-speed modems-- direct links, and network connections.
- Each entry in the Devices file has the following format:
-
Type Line Line2 Class Dialer-Token-Pairs
|
- Here is an entry in /etc/uucp/Devices for a US Robotics V.32bis modem attached to port A and running at 38,400 bps.
-
ACUEC cua/a - 38400 usrv32bis-ec
|
- Each field is described below.
Type Field
- This field describes the type of link that the device will establish. It may contain one of the following keywords:
-
Direct Keyword The Direct keyword mainly appears in entries for cu connections. This keyword indicates that the link is a direct link to another computer or a port selector. A separate entry should be made for each line that you want to reference through the -l option of cu.
-
ACU Keyword The ACU keyword indicates that the link to a remote computer (whether through cu, UUCP, or PPP) is made through a modem. This modem may be connected either directly to your computer or indirectly through a port selector.
-
Port Selector This is a variable that is replaced in the Type field by the name of a port selector. Port selectors are devices attached to a network that prompt for the name of a calling modem and then grant access. The file /etc/uucp/Dialers contains caller scripts only for the micom and develcon port selectors. You can add your own port selector entries to the Dialers file. (See "/etc/uucp/Dialers File" on page 198 for more information.)
-
Sys-Name This variable is replaced by the name of a machine in the Type field, indicating that the link is a direct link to this particular computer. This naming scheme is used to associate the line in this Devices entry to an entry in /etc/uucp/Systems for the computer Sys-Name.
-
Type Field and /etc/uucp/Systems File Table 12-7 shows a comparison between the fields in /etc/uucp/Devices and fields in /etc/uucp/Systems. The titles of each column apply only to fields in the Devices file.
- The keyword used in the Type field of the Devices file is matched against the third field of the Systems file entries, as indicated in the shaded fields in Table 12-7. In the Devices file, the Type field has the entry ACUEC, indicating an automatic call unit, in this case a V.32bis modem. This value is matched against the third field in the Systems file, which also contains the entry ACUEC. (See "/etc/uucp/Systems File" on page 183 for more information.)
-
Table 12-7 Type/etc/uucp/Systems
| Type | Line | Line2 | Class |
|
| Field | Field | Field | Field | Dialer-Token-Pairs Field |
| Devices | ACUEC | cua/a | - | 38400 | usrv32bis-ec |
-
| Systems File | nubian Any | ACUEC | 38400 | 9998888 "" \d\d\r\n\c-ogin-\r\n\c-ogin....... |
Line Field
- This field contains the device name of the line (port) associated with the Devices entry. For instance, if the modem associated with a particular entry was attached to the /dev/cua/a device (serial port A), the name entered in this field would be cua/a. There is an optional modem control flag, M, that can be used in the Line field to indicate that the device should be opened without waiting for a carrier. For example:
-
Line2 Field
- This field is a placeholder. Always use a hyphen (-) here. 801 type dialers, which are not supported in the Solaris environment, use the Line2 field. Non- 801 dialers will not normally use this configuration, but still require a hyphen in this field.
Class Field
- The Class field contains the speed of the device, if the keyword ACU or Direct is used in the Type field. However, it may contain a letter and a speed (for example, C1200, D1200) to differentiate between classes of dialers (Centrex or Dimension PBX).
- This is necessary because many larger offices may have more than one type of telephone network: one network may be dedicated to serving only internal office communications while another handles the external communications. In such a case, it becomes necessary to distinguish which line(s) should be used for internal communications and which should be used for external communications.
- The keyword used in the Class field of the Devices file is matched against the Speed field of Systems file as shown in Table 12-8. Note that the titles of each column apply only to fields in the Devices file.
-
Table 12-8
|
Type |
Line | Line
2 |
Class |
|
| Field | Field | Field | Field | Dialer-Token-Pairs Field |
| Devices file: | ACU | cua/
b | - | D2400 | hayes |
| Systems file: | gobi | Any | ACU | D2400 | 3251 ogin: nuucp ssword: taheya |
- Some devices can be used at any speed, so the keyword Any may be used in the Class field. If Any is used, the line will match any speed requested in the Speed field of the Systems file. If this field is Any and the Systems file Speed field is Any, the speed defaults to 2400 bps.
Dialer-Token-Pairs Field
- The Dialer-Token-Pairs (DTP) field contains the name of a dialer and the token to pass it. The DTP field has the following syntax:
-
dialer token [dialer token]
- The dialer portion may be the name of a modem, a port monitor, or it may be direct or uudirect for a direct link device. You can have any number of dialer-token pairs; if not present, it will be taken from a related entry in the Systems file. The token portion may be supplied immediately following the dialer portion.
- The last dialer token pair may not be present, depending on the associated dialer. In most cases, the last pair contains only a dialer portion. The token portion is retrieved from the Phone field of the associated Systems file entry.
- A valid entry in the dialer portion may be defined in the Dialers file or may be one of several special dialer types. These special dialer types are compiled into the software and are therefore available without having entries in the Dialers file. The special dialer types include:
-
Table 12-9
| TCP | TCP/IP network |
| TLI | Transport Level Interface Network (without STREAMS) |
| TLIS | Transport Level Interface Network (with STREAMS) |
- See "Protocol Definitions in the Devices File" on page 197 for more information.
-
Structure of the Dialer-Token-Pairs Field The DTP field may be structured four different ways, depending on the device associated with the entry:
-
- Directly Connected Modem
If a modem is connected directly to a port on your computer, the DTP field of the associated Devices file entry will have only one pair. This pair would normally be the name of the modem. This name is used to match the particular Devices file entry with an entry in the Dialers file. Therefore,
- the Dialer field must match the first field of a Dialers file entry as shown in Table 12-10. (The titles of each column apply only to fields in the Devices file.)
-
Table 12-10/etc/uucp/Dialers
| Type
Field | Line
Field | Line2
Field | Clas
s |
Dialer-Token-Pairs |
Device
s | ACU | cua/
b | - | 2400 | hayes |
-
Dialer
s | haye
s | =,-, | "" | \\dA\pTE1V1X1Q0S2=255S12=255\r\c \EATDT\T\r\c CONNECT |
- Notice that only the dialer portion (hayes) is present in the DTP field of the Devices file entry. This means that the token to be passed on to the dialer (in this case the phone number) is taken from the Phone field of a Systems file entry. (\T is implied, as described on page 197.)
-
- Direct Link
For a direct link to a particular computer, the DTP field of the associated entry would contain the keyword direct. This is true for both types of direct-link entries, Direct and Sys-Name (refer to "Type Field" on page 191).
- Computers on the Same Port Selector
If a computer with which you wish to communicate is on the same port selector switch as your computer, your computer must first access the switch. The switch will then make the connection to the other computer. This type of entry has only one pair. The dialer portion is used to match a Dialers file entry as shown in Table 12-11 on page 196. (The titles of each column apply only to fields in the Devices file.
- )
-
Table 12-11
| Type
Field | Line
Field | Line2
Field | Clas
s |
Dialer-Token-Pairs |
Device
s | develco
n | cua/
a | - | 1200 | develcon |
-
Dialer
s | develco
n | ,"" | "" | \pr\ps\c est:\007 \E\D\e
\007 |
- As shown, the token portion is left blank. This indicates that it is retrieved from the Systems file. The Systems file entry for this computer will contain the token in the Phone field, which is normally reserved for the phone number of the computer. (Refer to "/etc/uucp/Systems File" on page 183.) This type of DTP contains an escape character (\D), which ensures that the contents of the Phone field will not be interpreted as a valid entry in the Dialcodes file.
-
- Modems Connected to Port Selector
If a high-speed modem is connected to a port selector, your computer must first access the port selector switch. The switch will make the connection to the modem. This type of entry requires two dialer-token-pairs. The dialer portion of each pair (fifth and seventh fields of entry) will be used to match entries in the Dialers file as shown in Table 12-10. (Note that the titles of each column apply only to fields in the Devices file.)
-
Table 12-12
File | Type
Field | Line
Field | Line2
Field |
Class | Dialer-Token-
Pairs |
|
| Device s | ACU | cua/ b | - | 1200 | develcon |
vent
|
-
-
-
Dialer ""
"" \pr\ps\c est:\007 \E\D\e \007
s
Dialer =&-%
t"" \r\p\r\c
$ <K\T%\r>\
ONLINE
- s
c
!
- In the first pair, develcon is the dialer and vent is the token that is passed to the Develcon switch to tell it which device (ventel modem) to connect to your computer. This token would be unique for each port selector since each switch may be set up differently. Once the ventel modem has been connected, the second pair is accessed, where ventel is the dialer and the token is retrieved from the Systems file.
- Two escape characters may appear in a DTP field:
-
-
\T-Indicates that the Phone (token) field should be translated using the /etc/uucp/Dialcodes file. This escape character is normally placed in the /etc/uucp/Dialers file for each caller script associated with a modem (hayes, usrobotics, and so on). Therefore, the translation will not take place until the caller script is accessed.
-
\D-Indicates that the Phone (token) field should not be translated using the /etc/uucp/Dialcodes file. If no escape character is specified at the end of a Devices entry, the \D is assumed (default). A \D is also used in the /etc/uucp/Dialers file with entries associated with network switches (develcon and micom).
Protocol Definitions in the Devices File
- You can define the protocol to use with each device in /etc/uucp/Devices. This usually is unnecessary because you can use the default or define the protocol with the particular system you are calling. (Refer to "/etc/uucp/Systems File" on page 183.) If you do specify the protocol, you must use the form:
-
Type,Protocol [parameters]
- For example, you can use TCP,te to specify the TCP/IP protocol.
-
Table 12-13 shows the available protocols for the Devices file:
-
Table 12-13/etc/uucp/Devices
| Protoco l | Description |
| t | This protocol is commonly used for transmissions over TCP/IP and other reliable connections. It assumes error-free transmissions. |
| g | This is UUCP's native protocol. It is slow, reliable, and good for transmission over noisy telephone lines. |
| e | This protocol assumes transmission over error-free channels that are message-oriented (as opposed to byte stream-oriented like TCP/IP). |
| f | This protocol is used for transmission over X.25 connections. It relies on flow control of the data stream, and it is meant for working over links that can (almost) be guaranteed to be error-free, specifically X.25/PAD links. A checksum is carried out over a whole file only. If a transport fails, the receiver can request retransmission(s). |
- Here is an example showing a protocol designation for a device entry:
-
- This example indicates that, for device TCP, try to use the t protocol. If the other end refuses, use the e protocol.
- Note that neither e nor t are appropriate for use over modems. Even if the modem assures error-free transmission, data can still be dropped between the modem and the CPU.
/etc/uucp/Dialers File
- The /etc/uucp/Dialers file contains dialing instructions for many commonly-used modems. You probably will not need to change or add entries to this file unless you plan to use a nonstandard modem or plan to customize your UUCP environment. Nevertheless, you should understand what is in the file and how it relates to the Systems and Devices file.
- The text specifies the initial conversation that must take place on a line before it can be made available for transferring data. This conversation, often referred to as a chat script, is usually a sequence of ASCII strings that is transmitted and expected, and it is often used to dial a phone number
- As shown in the examples in "/etc/uucp/Devices File" the fifth field in a Devices file entry is an index into the Dialers file or a special dialer type (TCP, TLI, or TLIS). The uucico daemon attempts to match the fifth field in the Devices file with the first field of each Dialers file entry. In addition, each odd-numbered Devices field, starting with the seventh position is used as an index into the Dialers file. If the match succeeds, the Dialers entry is interpreted to perform the dialer conversation.
- Each entry in the Dialers file has the following format:
-
dialer substitutions
-
expect-send
-
Table 12-14 shows the entry for a US Robotics V.32bis modem.:
-
Table 12-14
| Dialer | Substitution s | Expect-Send |
| usrv32bis-e | =,-, "" | dA\pT&FE1V1X1Q0S2=255S12=255&A1&H1&M5&B2&W\r\c OK\r \EATDT\T\r\c CONNECT\s14400/ARQ STTY=crtscts |
- The Dialer field matches the fifth and additional odd-numbered fields in the Devices file. The Substitutions field is a translate string: the first of each pair of characters is mapped to the second character in the pair. This is usually used to translate = and - into whatever the dialer requires for "wait for dial tone" and "pause."
- The remaining Expect-Send fields are character strings.
-
Code Example 12-1 on page 200 shows some sample entries in the Dialers file as distributed when you install UUCP as part of the Solaris installation program.
-
Code Example 12-1 Excerpts from /etc/uucp/Dialers.
-
penril=W-P "" \d > Q\c : \d- > s\p9\c )-W\p\r\ds\p9\c-) y\c : \E\TP > 9\c OK
ventel=&-%"" \r\p\r\c $ <K\T%%\r>\c ONLINE!
vadic=K-K"" \005\p *-\005\p-*\005\p-* D\p BER? \E\T\e \r\c LINE
develcon """" \pr\ps\c est:\007 \E\D\e \n\007
micom"" "" \s\c NAME? \D\r\c GO
hayes=,-,"" \dA\pTE1V1X1Q0S2=255S12=255\r\c OK\r \EATDT\T\r\c CONNECT
# Telebit TrailBlazer
tb1200=W-,"" \dA\pA\pA\pTE1V1X1Q0S2=255S12=255S50=2\r\c OK\r \EATDT\T\r\c CONNECT\s1200
tb2400=W-,"" \dA\pA\pA\pTE1V1X1Q0S2=255S12=255S50=3\r\c OK\r \EATDT\T\r\c CONNECT\s2400
tbfast=W-,"" \dA\pA\pA\pTE1V1X1Q0S2=255S12=255S50=255\r\c OK\r \EATDT\T\r\c CONNECT\sFAST
# USrobotics, Codes, and DSI modems
dsi-ec =,-, "" \dA\pTE1V1X5Q0S2=255S12=255*E1*F3*M1*S1\r\c OK\r \EATDT\T\r\c
CONNECT\sEC STTY=crtscts
dsi-nec =,-, "" \dA\pTE1V1X5Q0S2=255S12=255*E0*F3*M1*S1\r\c OK\r \EATDT\T\r\c CONNECT
STTY=crtscts
usrv32bis-ec =,-, "" \dA\pT&FE1V1X1Q0S2=255S12=255&A1&H1&M5&B2&W\r\c OK\r \EATDT\T\r\c
CONNECT\s14400/ARQ STTY=crtscts
usrv32-nec =,-, "" \dA\pT&FE1V1X1Q0S2=255S12=255&A0&H1&M0&B0&W\r\c OK\r \EATDT\T\r\c
CONNECT STTY=crtscts
codex-fast =,-, "" \dA\pT&C1&D2*MF0*AA1&R1&S1*DE15*FL3S2=255S7=40S10=40*TT5&W\r\c OK\r
\EATDT\T\r\c CONNECT\s38400 STTY=crtscts
tb9600-ec =W-, "" \dA\pA\pA\pTE1V1X1Q0S2=255S12=255S50=6\r\c OK\r
\EATDT\T\r\cCONNECT\s9600 STTY=crtscts
tb9600-nec =W-, "" \dA\pA\pA\pTE1V1X1Q0S2=255S12=255S50=6S180=0\r\c OK\r \EATDT\T\r\c
CONNECT\s9600 STTY=crtscts
|
- Here is a list of escape characters commonly used in the send strings in the Dialers file:
-
Table 12-15/etc/uucp/Dialers
| Characte r | Description |
| \b | Send or expect a backspace character |
| \c | No newline or carriage return. |
| \d | Delay (approximately 2 seconds). |
| \D | Phone number or token without Dialcodes translation. |
| \e | Disable echo checking. |
| \E | Enable echo checking (for slow devices). |
| \K | Insert a Break character. |
| \n | Send newline. |
| \nnn | \nnn - Send octal number. Additional escape characters that may be used are listed in the section "/etc/uucp/Systems File" on page 183. |
| \N | Send or expect a null character (ASCII NUL). |
| \p | Pause (approximately 12-14 seconds). |
| \r | Return. |
| \s | Send or expect a space character. |
| \T | Phone number or token with Dialcodes translation. |
- Here is a penril entry in the Dialers file:
-
penril =W-P "" \d > Q\c : \d- > s\p9\c )-W\p\r\ds\p9\c-) y\c : \E\TP > 9\c OK
|
- First, the substitution mechanism for the phone number argument is established, so that any = will be replaced with a W (wait for dial tone) and any - with a P (pause).
- The handshake given by the remainder of the line works as listed:
-
-
"" - Wait for nothing. (that is, proceed to the next thing.)
-
-
\d - Delay 2 seconds, then send a carriage return.
-
>-Wait for a >.
-
Q\c - Send a Q without a carriage return.
-
: - Expect a :.
-
\d- - Delay 2 seconds, send a - and a carriage return.
-
> - Wait for a >.
-
s\p9\c - Send an s, pause, send a 9 with no carriage return.
-
)-W\p\r\ds\p9\c-) - Wait for a ). If it is not received, process the string between the - characters as follows. Send a W, pause, send a carriage-return, delay, send an s, pause, send a 9, without a carriage return, and then wait for the ).
-
y\c - Send a y with no carriage return.
-
:- Wait for a :.
-
\E\TP - Enable echo checking. (From this point on, whenever a character is transmitted, it will wait for the character to be received before doing anything else.) Then, send the phone number. The \T means take the phone number passed as an argument and apply the Dialcodes translation and the modem function translation specified by field 2 of this entry. Then send a P and a carriage-return.
-
> - Wait for a >.
-
9\c - Send a 9 without a new line.
-
OK - Wait for the string OK.
Hardware Flow Control
- You can also use the pseudo-send STTY=value string to set modem characteristics. For instance, STTY=crtscts enables hardware flow control.
-
STTY accepts all the stty modes. See the stty(1V) and termio(4) man pages.
- The following example would enable hardware flow control in a Dialers entry:
-
dsi =,-, "" \dA\pTE1V1X5Q0S2=255S12=255*E1*F3*M1*S1\r\c OK\r
\EATDT\T\r\c CONNECT\sEC STTY=crtscts
|
- This pseudo-send string can also be used in entries in the Systems file.
Setting Parity
- In some cases, you will have to reset the parity because the system that you are calling checks port parity and drops the line if it is wrong. The expect-send couplet ~~ P_ZERO sets parity to zero:
-
foo =,-, "" P_ZERO "" \dA\pTE1V1X1Q0S2=255S12=255\r\c OK\r\EATDT\T\r\c CONNECT
|
- In the same manner, P_EVEN sets it to even (the default); P_ODD sets it to odd; and P_ONE sets it to one. This pseudo-send string can also be used in entries in the Systems file.
Other Basic Configuration Files
- The files in this section can be used in addition to the Systems, Devices, and Dialers file when doing basic UUCP configuration.
/etc/uucp/Dialcodes File
- The /etc/uucp/Dialcodes file enables you to define dial-code abbreviations that can be used in the Phone field in the /etc/uucp/Systems file. You can use the Dialcodes file to provide additional information about a basic phone number that is used by several systems at the same site.
- Each entry has the format:
-
abbreviation dial-sequence
- where abbreviation represents the abbreviation used in the Phone field of the Systems file and dial-sequence represents the dial sequence passed to the dialer when that particular Systems file entry is accessed. Table 12-16 shows the correspondences between the two files.
-
Table 12-16DialcodesSystems
| Field Names |
|
| Dialcode s | Abbreviation | Dial Sequence |
-
| Systems | System-Name | Time | Typ e | Spee d | Phon e | Chat Script |
-
Table 12-17 contains sample entries in a Dialcodes file.
-
Table 12-17
| abbreviatio n | dial-sequence |
| NY | 1=212 |
| jt | 9+847 |
- In the first row, NY is the abbreviation to appear in the Phone field of the Systems file. For example, the Systems file might have the entry:
-
-
NY5551212
- When uucico reads NY in the Systems file, it searches the Dialcodes file for NY and obtains the dialing sequence 1=212. This is the dialing sequence needed for any phone call to New York City. It includes the number 1, an equal sign (=) meaning pause and wait for a secondary dial tone, and the area code 212. uucico sends this information to the dialer, then returns to the Systems file for the remainder of the phone number, 5551212.
- The entry jt 9=847-
- would work with a Phone field in the Systems file such as jt7867. When uucico reads the entry containing jt7867 in the Systems file, it would send the sequence 9=847-7867 to the dialer if the token in the dialer-token-pair is \T.
/etc/uucp/Sysfiles File
- The /etc/uucp/Sysfiles file lets you assign different files to be used by uucp and cu as Systems, Devices, and Dialers files. (For more information on cu, see the cu(1c) man page.) You may want to use Sysfiles for:
-
- Different Systems files, so that requests for login services can be made to different addresses than uucp services.
- Different Dialers files, so that you can assign different handshaking for cu and uucp.
- Multiple Systems, Dialers, and Devices files. The Systems file in particular may become large, making it more convenient to split it into several smaller files.
- The format of the Sysfiles file is:
-
-
service=w systems=x:x dialers=y:y devices=z:z
-
w represents uucico, cu, or both separated by a colon. x represents one or more files to be used as the Systems file, with each file name separated by a colon and read in the order presented. y represents one or more files to be used as the Dialers file. z is one or more files to be used as the Devices file.
- Each file name is assumed to be relative to the /etc/uucp directory, unless a full path is given.
- Below is a sample /etc/uucp/Sysfiles that defines a local Systems file (Local_Systems) in addition to the standard /etc/uucp/Systems file:
-
service=uucico:cu systems=Systems :Local_Systems
|
- When this entry is in /etc/uucp/Sysfiles, both uucico and cu will first look in the standard /etc/uucp/Systems. If the system they are trying to call doesn't have an entry in that file, or if the entries in the file fail, then they look in /etc/uucp/Local_Systems.
- Given the above entry, cu and uucico will share the Dialers and Devices files.
- When different Systems files are defined for uucico and cu services, your machine will store two different lists of Systems. You can print the uucico list using the uuname command or the cu list using the uuname -c command. Another example of the file, where the alternate files are consulted first and the default files are consulted in case of need is:
-
service=uucico systems=Systems.cico:Systems
dialers=Dialers.cico:Dialers \
devices=Devices.cico:Devices
service=cu systems=Systems.cu:Systems \
dialers=Dialers.cu:Dialers \
devices=Devices.cu:Devices
|
/etc/uucp/Sysname File
- Every machine that uses UUCP must have an identifying name, often referred to as the node name. This is the name that appears in the remote machine's /etc/uucp/Systems file along with the chat script and other identifying information. Normally, UUCP uses the same node name as is returned by the uname -n command, which is also used by TCP/IP.
- You can specify a UUCP node name independent of the TCP/IP host name by creating the /etc/uucp/Sysname file. The file have a one line entry containing the UUCP node name for your system.
/etc/uucp/Permissions File
- The /etc/uucp/Permissions file specifies the permissions that remote computers have with respect to login, file access, and command execution. There are options that restrict the remote computer's ability to request files and its ability to receive files queued by the local machine. Another option is available that specifies the commands that a remote machine can execute on the local computer.
Structuring Entries
- Each entry is a logical line with physical lines terminated by a backslash (\) to indicate continuation. Entries are made up of options delimited by blank space. Each option is a name/value pair in the following format:
-
name=value
-
Values may be colon-separated lists. Note that no blank space is allowed within an option assignment.
- Comment lines begin with a pound sign (#), and they occupy the entire line up to a newline character. Blank lines are ignored (even within multiple-line entries).
- There are two types of Permissions file entries:
-
-
LOGNAME-Specifies the permissions that take effect when a remote computer logs in to (calls) your computer.
-
Note - When a remote machine calls you, its identity is questionable unless it has a unique login and verifiable password.
-
-
MACHINE-Specifies permissions that take effect when your computer logs in to (calls) a remote computer.
-
LOGNAME entries contain a LOGNAME option and MACHINE entries contain a MACHINE option. One entry may contain both options.
Considerations
- When using the Permissions file to restrict the level of access granted to remote computers, you should consider the following:
-
-
- The commands sent by the remote computer for execution on your computer must be one of the default commands, usually rmail.
REQUEST Option
- When a remote computer calls your computer and requests to receive a file, this request can be granted or denied. The REQUEST option specifies whether the remote computer can request to set up file transfers from your computer. The string REQUEST=yes specifies that the remote computer can request to transfer files from your computer. The string REQUEST=no specifies that the remote computer cannot request to receive files from your computer. This is the default value; it will be used if the REQUEST option is not specified. The REQUEST option can appear in either a LOGNAME (remote computer calls you) entry or a MACHINE (you call remote computer) entry.
SENDFILES Option
- When a remote computer calls your computer and completes its work, it may attempt to take work your computer has queued for it. The SENDFILES option specifies whether your computer can send the work queued for the remote computer.
- The string SENDFILES=yes specifies that your computer may send the work that is queued for the remote computer as long as it logged in as one of the names in the LOGNAME option. This string is mandatory if you have entered Never in the Time field of /etc/uucp/Systems. This designation sets up your local machine in passive mode; it is not allowed to initiate a call to this particular remote computer. (See "/etc/uucp/Systems File" on page 183 for more information.)
- The string SENDFILES=call specifies that files queued in your computer will be sent only when your computer calls the remote computer. The call value is the default for the SENDFILE option. This option is only significant in LOGNAME entries since MACHINE entries apply when calls are made out to remote computers. If the option is used with a MACHINE entry, it will be ignored.
MYNAME Option
- This option enables you to designate a unique UUCP node name for your computer in addition to its TCP/IP host name, as returned by the hostname command. For instance, if you have unknowingly given your host the same name as that of some other system, you might want to set the MYNAME option of the Permissions file. Or if you want your organization to be known as widget but all your modems are connected to a machine with the host name gadget, you can have an entry in gadget's Permissions file that says:
-
LOGNAME=Uworld MYNAME=widget
|
- Now the system world will log in to the machine gadget as if it were logging in to widget. In order for machine world to know you also by the aliased name widget when you call it, you can have an entry that says:
-
MACHINE=world MYNAME=widget
|
- You can also use the MYNAME option for testing purposes, since it allows your machine to call itself. However, since this option could be used to mask the real identity of a machine, you should use the VALIDATE option, as described in "VALIDATE Option" on page 213.
READ and WRITE Options
- These options specify the various parts of the file system that uucico can read from or write to. You can designate READ and WRITE options with either MACHINE or LOGNAME entries.
- The default for both the READ and WRITE options is the uucppublic directory, as shown in the following strings:
-
READ=/var/spool/uucppublic
WRITE=/var/spool/uucppublic
|
- The strings READ=/ and WRITE=/ specify permission to access any file that can be accessed by a local user with Other permissions.
- The value of these entries is a colon-separated list of path names. The READ option is for requesting files, and the WRITE option is for depositing files. One of the values must be the prefix of any full path name of a file coming in or going out. To grant permission to deposit files in /usr/news as well as the public directory, use the following values with the WRITE option:
-
WRITE=/var/spool/uucppublic:/usr/news
|
- If the READ and WRITE options are used, all path names must be specified because the path names are not added to the default list. For instance, if the /usr/news path name was the only one specified in a WRITE option, permission to deposit files in the public directory would be denied.
- You should be careful what directories you make accessible for reading and writing by remote systems. For example, the /etc directory contains many critical system files; remote users should not have permission to deposit files in this directory.
NOREAD and NOWRITE Options
- The NOREAD and NOWRITE options specify exceptions to the READ and WRITE options or defaults. The entry:
-
READ=/ NOREAD=/etc WRITE=/var/spool/uucppublic
|
- permits reading any file except those in the /etc directory (and its subdirectories--remember, these are prefixes). It permits writing only to the default /var/spool/uucppublic directory. NOWRITE works in the same manner as the NOREAD option. You can use the NOREAD and NOWRITE options in both LOGNAME and MACHINE entries.
CALLBACK Option
- You can use the CALLBACK option in LOGNAME entries to specify that no transaction will take place until the calling system is called back. There are two reasons to set up CALLBACK: For security purposes, if you call back a machine,
- you can be sure it is the right machine. For an accounting purposes, if you are doing long data transmissions, you can choose the machine that will be billed for the longer call.
- The string CALLBACK=yes specifies that your computer must call the remote computer back before any file transfers will take place.
- The default for the CALLBACK option is CALLBACK=no. If you set CALLBACK to yes, then the permissions that affect the rest of the conversation must be specified in the MACHINE entry corresponding to the caller. Do not specify these permissions in the LOGNAME, as well as in the LOGNAME entry that the remote machine may have set for your host.
- Note that if two sites have the CALLBACK option set for each other, a conversation will never get started.
COMMANDS Option
-
Caution - The COMMANDS option can compromise the security of your system. Use it with extreme care.
- You can use the COMMANDS option in MACHINE entries to specify the commands that a remote computer can execute on your machine. The uux program will generate remote execution requests and queue them to be transferred to the remote computer. Files and commands are sent to the target computer for remote execution.
- This is an exception to the rule that MACHINE entries apply only when your system calls out.
- Note that COMMANDS is not used in a LOGNAME entry; COMMANDS in MACHINE entries define command permissions whether you call the remote system or it calls you.
- The string COMMANDS=rmail specifies the default commands that a remote computer can execute on your computer. If a command string is used in a MACHINE entry, the default commands are overridden. For instance, the entry
-
MACHINE=owl:raven:hawk:dove COMMANDS=rmail:rnews:lp
|
- overrides the COMMAND default so that the computers named owl, raven, hawk, and dove can now execute rmail, rnews, and lp on your computer.
- In addition to the names as specified above, there can be full path names of commands. For example,
-
COMMANDS=rmail:/usr/local/rnews:/usr/local/lp
|
- specifies that command rmail uses the default search path. The default search path for UUCP is /bin and /usr/bin. When the remote computer specifies rnews or /usr/local/rnews for the command to be executed, /usr/local/rnews will be executed regardless of the default path. Likewise, /usr/local/lp is the lp command that will be executed.
- Including the ALL value in the list means that any command from the remote computers specified in the entry will be executed. If you use this value, you give the remote computers full access to your machine.
-
Caution - This allows far more access than normal users have. You should use this value only when both machines are at the same site, are closely connected, and the users are trusted.
- The string:
-
COMMANDS=/usr/local/rnews:ALL:/usr/local/lp
|
- illustrates two points:
-
- The ALL value can appear anywhere in the string
- The path names specified for rnews and lp will be used (instead of the default) if the requested command does not contain the full path names for rnews or lp.
- You should use the VALIDATE option whenever you specify potentially dangerous commands like cat and uucp with the COMMANDS option. Any command that reads or writes files is potentially dangerous to local security when executed by the UUCP remote execution daemon (uuxqt).
VALIDATE Option
- Use the VALIDATE option in conjunction with the COMMANDS option whenever you specify commands that are potentially dangerous to your machine's security. (VALIDATE is merely an added level of security on top of the COMMANDS option, though it is a more secure way to open command access than ALL.)
-
VALIDATE provides a certain degree of verification of the caller's identity by cross-checking the host name of a calling machine against the login name it uses. The string
-
LOGNAME=Uwidget VALIDATE=widget:gadget
|
- ensures that if any machine other than widget or gadget tries to log in as Uwidget, the connection is refused. The VALIDATE option requires privileged computers to have a unique login and password for UUCP transactions. An important aspect of this validation is that the login/password associated with this entry be protected. If an outsider gets that information, that particular VALIDATE option can no longer be considered secure.
- Carefully consider which remote computers you will grant privileged login/passwords for UUCP transactions. Giving a remote computer a special login and password with file access and remote execution capability is like giving anyone on that computer a normal login and password on your computer. Therefore, if you cannot trust someone on the remote computer, do not provide that computer with a privileged login and password.
- The LOGNAME entry
-
LOGNAME=uucpfriend VALIDATE=eagle:owl:hawk
|
- specifies that if one of the remote computers that claims to be eagle, owl, or hawk logs in on your computer, it must have used the login uucpfriend. If an outsider gets the uucpfriend login/password, masquerading is trivial.
- But what does this have to do with the COMMANDS option, which only appears in MACHINE entries?
- It links the MACHINE entry (and COMMANDS option) with a LOGNAME entry associated with a privileged login. This link is needed because the execution daemon is not running while the remote computer is logged in. In fact, it is an asynchronous process that does not know which computer sent the execution request. Therefore, the real question is, how does your computer know where the execution files came from?
- Each remote computer has its own spool directory on your local machine. These spool directories have write permission given only to the UUCP programs. The execution files from the remote computer are put in its spool directory after being transferred to your computer. When the uuxqt daemon runs, it can use the spool directory name to find the MACHINE entry in the Permissions file and get the COMMANDS list. Or, if the computer name does not appear in the Permissions file, the default list will be used.
- The following example shows the relationship between the MACHINE and LOGNAME entries:
-
MACHINE=eagle:owl:hawk REQUEST=yes \
COMMANDS=rmail:/usr/local/rnews \
READ=/ WRITE=/
LOGNAME=uucpz VALIDATE=eagle:owl:hawk \
REQUEST=yes SENDFILES=yes \
READ=/ WRITE=/
|
- The value in the COMMANDS option means that remote users can execute rmail and /usr/local/rnews.
- In the first entry, you must assume that when you want to call one of the computers listed, you are really calling either eagle, owl, or hawk. Therefore, any files put into one of the eagle, owl, or hawk spool directories is put there by one of those computers. If a remote computer logs in and says that it is one of these three computers, its execution files will also be put in the privileged spool directory. You therefore have to validate that the computer has the privileged login uucpz.
MACHINE Entry for OTHER
- You may want to specify different option values for remote machines that are not mentioned in specific MACHINE entries. The need may arise when many computers are calling your host, and the command set changes from time to time. The name OTHER for the computer name is used for this entry as shown in this example:
-
MACHINE=OTHER \
COMMANDS=rmail:rnews:/usr/local/Photo:/usr/local/xp
|
- All other options available for the MACHINE entry may also be set for the computers that are not mentioned in other MACHINE entries.
Combining MACHINE and LOGNAME
- You can combine MACHINE and LOGNAME entries into a single entry where the common options are the same. For example, the two entries
-
MACHINE=eagle:owl:hawk REQUEST=yes \
READ=/ WRITE=/
|
- and
-
LOGNAME=uupz REQUEST=yes SENDFILES=yes \
READ=/ WRITE=/
|
- share the same REQUEST, READ, and WRITE options. You can merge them, as shown:
-
MACHINE=eagle:owl:hawk REQUEST=yes \
logname=uucpz SENDFILES-yes \
READ=/ WRITE=/
|
- Combining MACHINE and LOGNAME entries makes the Permissions file more manageable and efficient.
Forwarding
- When sending files through a series of machines, the intermediary machines must have the command uucp among their COMMANDS options. That is, if you type the command:
-
% uucp sample.txt oak\!willow\!pine\!/usr/spool/uucppublic
|
- this forwarding operation will work only if machine willow permits oak to execute the program uucp, and if oak permits your machine to do the same. The machine pine, being the last machine designated, does not have to permit the command uucp. Machines are not normally set up this way.
/etc/uucp/Poll File
- The /etc/uucp/Poll file contains information for polling remote computers. Each entry in the Poll file contains the name of a remote computer to call, followed by a tab character or a space, and finally the hours the computer should be called. The format of entries in the Poll file are:
-
sys-name hour ...
- For example, the entry
-
- provides polling of computer eagle every four hours.
- The uudemon.poll script processes the Poll file but does not actually perform the poll. It merely sets up a polling work file (always named C.file) in the spool directory. The uudemon.poll script starts the scheduler, and the scheduler examines all work files in the spool directory.
/etc/uucp/Config File
- The /etc/uucp/Config file enables you to override certain parameters manually. Each entry in the Config file has the following format:
-
parameter=value
- See the Config file provided with your system for a complete list of configurable parameter names.
- The following Config entry sets the default protocol ordering to Gge and changes the G protocol defaults to 7 windows and 512-byte packets.
-
/etc/uucp/Grades File
- The /etc/uucp/Grades file contains the definitions for the job grades that may be used to queue jobs to a remote computer. It also contains the permissions for each job grade. Each entry in this file represents a definition of an administrator-defined job grade that lets users queue jobs.
- Each entry in the Grades file has the following format:
-
User-job-grade System-job-grade Job-size Permit-type ID-list
- Each entry contains fields that are separated by blank space. The last field in the entry is made up of subfields also separated by spaces. If a entry takes up more than one physical line, then you can use a backslash to continue the entry onto the following line. Comment lines begin with a pound sign (#) and occupy the entire line. Blank lines are always ignored.
User-job-grade Field
- This field contains an administrative-defined user job grade name of up to 64 characters.
System-job-grade Field
- This field contains a one character job grade to which User-job-grade will be mapped. The valid list of characters is A-Z, a-z, with A having the highest priority and z the lowest.
Relationship between User and System Job Grades
- The user job grade may be bound to more than one system job grade. It is important to note that the Grades file will be searched sequentially for occurrences of a user job grade. Therefore, any multiple occurrences of a system job grade should be listed according to the restriction on the maximum job size.
- While there is no maximum number for the user job grades, the maximum number of system job grades allowed is 52. The reason is that more than one User-job-grade can be mapped to a System-job-grade, but each User-job-grade job grade must be on a separate line in the file. Here is an example:
-
mail N Any User Any netnews N Any User Any
|
- Given this configuration in a Grades file, these two User-job-grade grades will share the same System-job-grade. Since the permissions for a Job-grade are associated with a User-job-grade and not a System-job-grade, two User-job-grades can share the same System-job-grades and have two different sets of permissions.
-
Default Grade You can define the binding of a default User-job-grade to a system job grade. You must use the keyword default as user job grade in the User-job-grade field of the Grades file and the system job grade that it is bound to. The Restrictions and ID fields should be defined as Any so that any user and any size job can be queued to this grade. Here is an example:
-
- If you do not define the default user job grade, then the built-in default grade Z, will be used. Because the restriction field default is Any, multiple occurrences of the default grade are not checked.
Job-size Field
- This field specifies the maximum job size that can be entered in the queue. Job-size is measured in bytes and may be a list of the options listed in Table 12-18:
-
Table 12-18
| nnnn | Integer specifying the maximum job size for this job grade |
| nK | Decimal number representing the number of kilobytes (K is an abbreviation for kilobyte) |
| nM | Decimal number representing the number of megabytes (M is an abbreviation for megabyte) |
| Any | Keyword specifying that there is no maximum job size |
- Here are some examples:
-
-
5000 represents 5000 bytes
-
10K represents 10 kilobytes
-
2M..represents 2 megabytes
Permit-type Field
- This field contains a keyword that denotes how to interpret the ID list.Table 12-19 lists the keywords and their meanings:
-
Table 12-19
| Keyword | ID List Contents |
| User | Login names of users permitted to use this job grade. |
| Non-user | Login names of users not permitted to use this job grade |
| Group | Group names whose members are permitted to use this group |
| Non-group | Group names whose members are not permitted to use this job grade |
ID-list Field
- This contains a list of login names or group names that are to be permitted or denied queuing to this job grade. The list of names are separated by blank space and terminated by a new line character. The keyword Any is used to denote that anyone is permitted to queue to this job grade.
Other UUCP Configuration Files
- This section describes three less-frequently modified files that impact the use of UUCP facilities.
/etc/uucp/Devconfig File
- The /etc/uucp/Devconfig file enables you to configure devices by service- uucp or cu. Devconfig entries define the STREAMS modules that are used for a particular device. They have the format:
- service=x device=y push=z[:z...]
-
x can be cu, uucico, or both separated by a colon. y is the name of a network and must match an entry in the Devices file. z is replaced by the names of STREAMS modules in the order that they are to be pushed onto the Stream. Different modules and devices can be defined for cu and uucp services.
- The following entries are for a STARLAN network and would most commonly be used in the file:
-
service=cu device=STARLAN push=ntty:tirdwr
service=uucico device=STARLAN push=ntty:tirdwr
|
- This example pushes ntty, and then tirdwr.
/etc/uucp/Limits File
- The /etc/uucp/Limits file controls the maximum number of simultaneous uucicos, uuxqts, and uuscheds that are running in the uucp networking. In most cases, the default values are fine and no changes are needed. If you want to change them, however, use any standard system text editor.
- The format of the Limits file is:
- service=x max=y:
-
x can be uucico, uuxqt or uusched, and y is the limit permitted for that service. The fields can be in any order and in lowercase.
- The following entries should most commonly be used in the Limits file:
-
service=uucico max=5
service=uuxqt max=5
service=uusched max=2
|
- The example allows five uucicos, five uuxqts, and two uuscheds running on your machine.
remote.unknown File
- There is one other file that affects the use of communication facilities, the remote.unknown file. This file is a binary program that executes when a machine not found in any of the Systems files starts a conversation. It will log the conversation attempt and drop the connection.
-
Caution - If you change the permissions of the remote.unknown file so it cannot execute, your system will accept connections from any system.
- This program executes when a machine that is not in any of the Systems starts a conversation. It will log the conversation attempt and fail to make a connection. If you change the permissions of this file so it cannot execute (chmod 000 remote.unknown), your system will accept any conversation requests. This is not a trivial change, and you should have very good reasons for doing it.
Administrative Files
- The UUCP administrative files are described below. These files are created in spool directories to lock devices, hold temporary data, or keep information about remote transfers or executions.
-
- Temporary Data Files (TM)-These data files are created by UUCP processes under the spool directory /var/spool/uucp/x when a file is received from another computer. The directory x has the same name as the remote computer that is sending the file. The names of the temporary data files have the format:
TM.pid.ddd
where pid is a process ID and ddd is a sequential three digit number starting at 0. When the entire file is received, the TM.pid.ddd file is moved to the path name specified in the C.sysnxxxx file (discussed below) that caused the transmission. If processing is abnormally terminated, the TM.pid.ddd file may remain in the x directory. These files should be automatically removed by uucleanup.
- Lock Files (LCK)-Lock files are created in the /var/spool/locks directory for each device in use. Lock files prevent duplicate conversations and multiple attempts to use the same calling device. Table 12-20 shows the different types of UUCP lock files.
-
Table 12-20
| File Name | Description |
| LCK..sys | sys represents the name of the computer using the file |
| LCK..dev | dev represents the name of a device using the file |
| LCK.LOG | LOG represents a locked UUCP log file |
- These files may remain in the spool directory if the communications link is unexpectedly dropped (usually on computer crashes). The lock files will be ignored (removed) after the parent process is no longer active. The lock file contains the process ID of the process that created the lock.
-
- Work File (C.)-Work files are created in a spool directory when work (file transfers or remote command executions) has been queued for a remote computer. The names of work files have the format:
C.sysnxxxx
- where sys is the name of the remote computer, n is the ASCII character representing the grade (priority) of the work, and xxxx is the four-digit job sequence number assigned by UUCP. Work files contain the following information:
-
- Full path name of the file to be sent or requested
- Full path name of the destination or user/file name
- User login name
- List of options
- Name of associated data file in the spool directory. If the uucp -c or uuto -p option was specified, a dummy name (D.0) is used
- Mode bits of the source file
- Remote user's login name to be notified upon completion of the transfer
-
- data file (.D)-Data files are created when you specify on the command line to copy the source file to the spool directory. The names of data files have the following format:
· D.systmxxxxyyy - Where systm is the first five characters in the name of the remote computer, xxxx is a four-digit job sequence number assigned by uucp. The four digit job sequence number may be followed by a subsequence number, yyy that is used when there are several D. files created for a work (C.) file.
-
X. (execute file) - Execute files are created in the spool directory prior to remote command executions. The names of execute files have the following format:
X.sysnxxxx
sys is the name of the remote computer. n is the character representing the grade (priority) of the work. xxxx is a four digit sequence number assigned by UUCP. Execute files contain the following information:
· Requester's login and computer name
· Name of file(s) required for execution
· Input to be used as the standard input to the command string
· Computer and file name to receive standard output from the command execution
· Command string
· Option lines for return status requests
|
|