UUCP has three main uses:
Until recently, UUCP was very popular in the UNIX world for a number of reasons:
The UUCP programs also allow you to connect your computer to a worldwide network of computer systems called Usenet. Usenet is a multihost electronic bulletin board with several thousand special interest groups; articles posted on one computer are automatically forwarded to all of the other computers on the network. The Usenet reaches millions of users on computer systems around the world on every continent.
In recent years, interest in UUCP has declined for a number of reasons:
Thus, while UUCP is still used by a number of legacy systems, few sites are installing new UUCP systems.
Nevertheless, a working knowledge of UUCP is still important for the UNIX system administrator for a number of reasons:
The Nutshell Handbook Using and Managing UUCP (O'Reilly & Associates) describes in detail how to set up and run a UUCP system, as well as how to connect to the Usenet. This chapter focuses solely on those aspects of UUCP that relate to computer security.
From the user's point of view, UUCP consists of two main programs:
UNIX 's electronic mail system also interfaces with the UUCP system. As most people use UUCP primarily for mail, this chapter also discusses the mail and rmail commands.
uucp [flags] source-file destination-file
UUCP filenames can be regular pathnames (such as /tmp/file1 ) or can have the form:
For example, to transfer the /tmp/file12 file from your local machine to the machine idr, you might use the command:
$ uucp /tmp/file12 idr!/tmp/file12 $
You can also use uucp to transfer a file between two remote computers, assuming that your computer is connected to both of the other two machines. For example, to transfer a file from prose to idr, you might use the command:
$ uucp prose!/tmp/myfile idr!/u1/lance/yourfile $
For security reasons, UUCP is usually configured so that files can be copied only into the /usr/spool/uucppublic directory: the UUCP public directory. Because /usr/spool/uucppublic is lengthy to type, UUCP allows you to abbreviate the entry with a tilde (~):
$ uucp file12 idr!~/anotherfile $
Notice that you can change the name of a file when you send it.
The C shell's history feature interprets the exclamation mark as a command to recall previously typed lines. As a result, if you are using csh and you wish to have the exclamation mark sent to the uucp program, you have to quote, or "escape," the exclamation mark with a backslash:
% uucp /tmp/file12 idr\!/tmp/file12 %
The uux command enables you to execute a command on a remote system. In its simplest form, uux reads an input file from standard input to execute a command on a remote computer. The command has the form:
uux - system\!command < inputfile
In the days before local area networks, uux was often used to print a file from one computer on the printer of another. For sites that don't have local area networks, uux is still useful for that purpose. For example, to print the file report on the computer idr , you might use the command:
$ uux - "idr!lpr" < report $
The notation idr!lpr causes the lpr command to be run on the computer called idr . Standard input for the lpr command is read by the UUCP system and transferred to the machine idr before the command is run.
Today, the main use of uux is to send mail and Usenet articles between machines that are not otherwise connected to LANS or the Internet.
You can use the uux command to send mail "by hand" from one computer to another by running the program rmail on a remote machine:
$ uux - "idr!rmail leon" Hi, Leon! How is it going? Sincerely, Mortimer ^D $
For example, you could send mail to leon on the idr machine simply by typing:
$ mail idr!leon Subject: Hi, Leon! How is it going? Sincerely, Mortimer ^D $
uucp , uux , and mail don't actually transmit information to the remote computer; they simply store it on the local machine in a spool file. The spool file contains the names of files to transfer to the remote computer and the names of programs to run after the transfer takes place. Spool files are normally kept in the /usr/spool/uucp directory (or a subdirectory inside this directory).
If the uux command is invoked without its -r option, the uucico ( UNIX -to -UNIX Copy-In-Copy-Out) program is executed immediately. In many applications, such as in sending email, the -r option is provided by default, and the commands are queued until the uucp queue is run at some later time. Normally, uucico is run on a regular basis by cron . However started, when the program uucico runs it initiates a telephone call to the remote computer and sends out the spooled files. If the phone is busy or for some other reason uucico is unable to transfer the spool files, they remain in the /usr/spool/uucp directory, and uucico tries again when it is run by cron or another invocation of uux .
When it calls the remote computer, uucico gets the login: and password: prompts as does any other user. uucico replies with a special username and password for logging into a special account. This account, sometimes named uucp or nuucp , has another copy of the uucico program as its shell; the uucico program that sends the files operates in the Master mode, while the uucico program receiving the files operates in the Slave mode.
After the files are transferred, a program on the remote machine named uuxqt executes the queued commands. Any errors encountered during remote command execution are captured and sent back as email to the initiating user on the first machine.