HostedDB - Dedicated UNIX Servers

-->
Internet Security Professional Reference:Using UUCP
Previous Table of Contents Next


The phone number may also contain an English word dialcode listed in the Dialcodes file. You can use English to describe each phone number and who it is for, and then let the system expand the listing into the actual numerical area code. Unfortunately, this helpful feature is not automatic. You need to list the area codes you want in the Systems file. This new file, Dialcodes, is described later in this chapter. Dialcodes are English words that can be used in place of area codes and dialing prefixes. The following sample file has two fields: the first is the English keyword, and the second is the dialstring that will be substituted:

toronto    9=1-416

When you specify the following phone number in the Systems file:

toronto5551212

it will be expanded to the following prior to dialing:

9=1-4165551212

In the original paper of Version 2 UUCP (written by David Nowitz), the Dialcodes file was originally intended to allow for the use of the same Systems files at different sites, simply by using different Dialcode files. The advantage to using this format is that only the Dialcodes file has to be different for the given site.

Some sample phone numbers are listed here:

4581422
14084291786

These two examples are simple phone numbers. The following number uses the comma to create a pause for a secondary dialtone.

9,,5551212
9,,06135551212,,,,,,,,123456789012

The preceding number uses several pauses to wait for a calling card tone before a calling card code is entered. The following example shows a number with a dialcode that will be expanded to provide the area code. See the section on Dialcodes for more information.

chicago8101242

The UUCP Chat Script

The final and possibly most difficult part of a UUCP entry is the chat script. The chat script is a combination of expect-send pairs that define the login sequence to gain access to the remote computer. Each pair is separated by a space, with optional subexpect-subsend pairs separated by hyphens. Consider the following example:

login:-BREAK-login: nuucp word: loginAok

uucico expects the remote system to print login:. If it doesn’t see one within a predefined period of time, send a BREAK signal, and expect login:. The BREAK signal is a modem break, which may wake up a getty running on the remote system, or cause that getty to switch speeds to something more reasonable. When your system sees the login:, it sends nuucp, and waits for the word: string. When your system receives it, you send loginAok, which is your password. When the script completes all these steps successfully, your workstation has logged in to the system.

If you don’t use the subexpect-subsend pairs, such as in the following command, you might not be able to log in if the system answers at a different speed from the speed at which you are calling. This type of mixup would prevent you from seeing the login prompt.

login: nuucp word: loginAok

Suppose, for example, that you are calling at 1200 baud, and the remote system answers at 2400 baud. You would need to send a BREAK twice, assuming that the related gettydefs entry goes from 2400->300->1200. Your chat script would look like this:

login:-BREAK-login:-BREAK-login: nuucp word: loginAok

The difference to note between the primary expect-send and the subexpect-subsend is that the subexepect-subsend will only be used if the expect string is not received. It should be pointed out that uucico stops looking at the incoming characters after a match is found for the expect text. However, it is commonplace to use the last text expected to ensure that the send sequence isn’t sent to the remote system too soon.

Before you can define the chat script, you need at least the uucp login name and password you use to access the remote system. You should then use the cu command to contact the remote system to find out what you need to define for the script. A sample session’s output look likes the following:

chare@unilabs> cu -l tty21
Connected

<send NEWLINE>
login: nuucp
Welcome to Unilabs Research

Shere=bugs
~.

To create a chat script for the system bugs, which is directly connected to the sample system, the setup looks like this:

expect nothing
send newline
expect login:
send nuucp

This setup translates into a chat script that looks like this:

“” \r\c login: nuucp

The pair of double quotes means “expect nothing”; \r\c is “send newline.” These special characters are used in chat scripts along with the extra characters listed in table 3.4.

Table 3.4
Chat Script Special Characters

Sequence Meaning

“” Expect null string
EOT Send an End Of Transmission character
BREAK Send a BREAK signal (may not be implemented on all systems)
@ Same as BREAK
\b Send a backspace
\c Suppress newline at the end of the string
\d Delay for one second
\E Start echo checking. (From now on, whenever a character is transmitted, it will wait for the character to be received before doing anything else.) Not implemented on all systems
\e Turn echo check off
\K Same as BREAK (BNU only)
\n Send newline or linefeed character
\N Send a NULL character (BNU only)
\0 Send a NULL character
\p Pause for a fraction of a second (BNU only)
\r Send a carriage return
\s Send a space character
\t Send a tab character
\\ Send a \ character
\nnn Translate the octal digits nnn into a single ASCII character and send that character


Previous Table of Contents Next