📄 lsg27.htm
字号:
<P>Most important of all is to ensure that whoever accesses your system on a regular basis is someone you want to have access. If you leave your system wide open for anyone to enter, you are inviting disaster. Carefully watch logins, and make sure file permissions and ownerships are properly set at all times.
<BR>
<BR>
<A NAME="E68E154"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Using UUCP</B></FONT></CENTER></H3>
<BR>
<P>Once you have configured UUCP, you can use it to transfer files and e-mail. In order to use UUCP, you have to know the addressing syntax, which is different from the Internet addressing syntax. The UUCP address syntax is
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">machine!target</FONT></PRE>
<P>where machine is the remote machine name and target is the name of the user or file that you are trying to get to. For example, to send mail to the user yvonne on machine arthur, you would use the mail command with a username destination:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">mail arthur!yvonne</FONT></PRE>
<P>UUCP lets you move through several machines to get to a target. This feature can help save money on telephone bills or make a much wider network available to you from a small number of connections. Suppose you want to send mail to a user called bill on a system called warlock, which isn't in your configuration files but can be connected to through arthur. If you have permission to send mail through the system arthur (called a <I>hop</I>), you can send the mail with this command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">mail arthur!warlock!bill</FONT></PRE>
<P>When UUCP decodes this address, it reads the first system name (arthur) and sends it to that system. The UUCP processes on arthur then examine the rest of the address and realize that the mail is to be sent on to warlock. If you have permission to forward through arthur, UUCP on arthur sends the mail through to warlock for you. You can have many hops in an address, as long as each system you are connecting to allows the pass-through and can connect to the next machine on the list. For example, the address
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">arthur!warlock!chatton!vader!alex</FONT></PRE>
<P>sends data through arthur, warlock, chatton, and vader in order, and then to the user alex. You must specify the addresses in the proper hop order or the address will fail. This multihop addressing can be very useful if a number of friends have local connections to other machines, allowing you to easily set up a complex network. The hard part is usually tracking the names of the systems involved.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>The exclamation mark in the address is called a <I>bang</I>, so the preceding address is spoken or written as "arthur-bang-warlock-bang-chatton-bang-vader-bang-alex." Shells like the C shell use the exclamation mark to recall previous commands, so you must escape the bang character with a slash to prevent the shell's interpretation. Addresses then become arthur\/!chatton\!yvonne. This looks funny, but you get used to it.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>Depending on how you have your UUCP system set, it may call out to the other systems in an address whenever something is submitted to it, or if callout times are limited, the data may be spooled until a call is allowed. You have already seen how to set callout times in the /usr/lib/uucp/sys and /usr/lib/uucp/Systems files.
<BR>
<P>A quick caution about relying on UUCP for delivery of information. If the systems that are being used are not set to call immediately when something is queued, your data can take a long time to get to its destination. For example, if one of the hops in your address only calls the next machine in the address once a day, you may have a 24-hour delay in delivery. This delay can be exacerbated by each machine in the network.
<BR>
<P>Also, don't rely on the contents of your data sent through UUCP to be kept confidential. Once your data is on a remote system, any user with access privileges to the queue could snoop into your data. Ideally, the file permissions will prevent anyone but the superuser accessing the data, but not all systems keep tight security. If you must send sensitive data, encrypt it and let the recipient know the decryption key through another format (not in a mail message).
<BR>
<P>UUCP deals with all transfers as <I>jobs</I>, a term you'll encounter often when working with UUCP and its documentation. A <I>job</I> is a command that is to be executed on the remote system, a file that is to be transferred to or from the remote system, or any other task that you want performed between the two systems.
<BR>
<BR>
<A NAME="E69E171"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Sending E-mail With UUCP</B></FONT></CENTER></H4>
<BR>
<P>Because most utilities, like mail packages, understand the UUCP addresses, you don't have to worry about e-mail not reaching the proper destination. You usually don't have to make any changes at all to applications running under Linux to get them to understand the UUCP address format. In the last section, you saw how you can use the mail package with UUCP addresses.
<BR>
<P>You can use any of the usual mail command options to modify the behavior of the package. For example, to send the contents of the file data_1 to yvonne on system chatton through the system arthur and tag the mail with a subject heading, issue the command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">mail -s "Data file" arthur!chatton!yvonne < data_1</FONT></PRE>
<P>Most mail packages available for Linux, including X-based mailers, work perfectly well with UUCP addresses as well as the more common Internet addresses, but you may want to check before adopting a new mail package.
<BR>
<BR>
<A NAME="E69E172"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Transferring Files With UUCP</B></FONT></CENTER></H4>
<BR>
<P>UUCP's most common use is to transfer files from one machine to another. To transfer files using UUCP, you use the uucp command. The syntax of this command is as follows:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uucp [options] source destination</FONT></PRE>
<P>The options supported by uucp vary a little depending on the version and type of UUCP implementation, but most versions support the following useful options:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
-c
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This option tells the program not to copy the file to a spool directory before sending. The default action is to copy to a spool directory. You can use the -C option to explicitly specify this action.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
-f
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This option tells the program not to create directories on the remote system if needed. The default action is<A NAME="I2"></A> to create directories as needed. You can use the -d option to explicitly specify this action.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
-m
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This option tells the program to send mail to the person who issued the uucp command when the copy is complete.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
-n<I>user</I>
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This option tells the program to send mail to the user on the remote system when the copy is complete.</FONT>
</TABLE><P>The default behaviors are usually sufficient for most users, although you may want the mail options when you need confirmation of an action.
<BR>
<P>Both source and destination are the names of files or directories as appropriate, much like the cp command. However, when you are dealing with a remote system for the source or destination, you need to format the file or directory in valid UUCP address format. For example, to send the data_1 file from your local machine's current directory to the directory /usr/spool/uucppublic on the machine arthur, use the command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uucp data_1 arthur!/usr/spool/uucppublic</FONT></PRE>
<P>Notice that the remote machine name was prepended to the full target directory name. In most cases, when transferring files to remote systems, you should use the uucppublic directories as you likely will not have permission to transfer files anywhere else in the filesystem. Once the file is on the remote system in the /usr/spool/uucppublic directory, it is up to the remote system's users to find the file and copy it to its intended destination directory.
<BR>
<P>If you want to send the same file to the user bill on the remote machine, store it in a subdirectory called /usr/spool/uucppublic/bill, and send mail to both yourself and bill when the copy is completed, issue the command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uucp -m -nbill data_1 arthur!/usr/spool/uucppublic/bill/</FONT></PRE>
<P>To copy a file from a remote machine to yours, you need to specify the location of the remote machine. Remember you must have access to the directory that the files reside in (as well as read permission on the file) or have the sender copy them to uucppublic. The command
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uucp chatton!/usr/tmp/bigfile /usr/tparker/</FONT></PRE>
<P>transfers the bigfile file from the directory /usr/tmp on the machine chatton to your /usr/tparker directory.
<BR>
<P>UUCP allows you to use wildcards, although you must escape them in quotation marks to prevent the shell misinterpreting them. For example, to copy all the files starting with chap on the remote machine warlock's /usr/bill/book directory (assuming you have permissions) to your own /usr/bigbook directory, issue the command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uucp "warlock!/usr/bill/book/chap*" /usr/bigbook/</FONT></PRE>
<P>You can specify hops in the machine transfers by adding the extra machine names to the command. This task requires permissions to be set on all the machines that the hop will pass through and is seldom done. You can transfer files from one remote system to another by specifying their names on the command line, as in the following example:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uucp arthur!/usr/lib/uucppublic/bigfile warlock!/usr/lib/uucppublic/</FONT></PRE>
<P>This command sends the file from the arthur system to the warlock system. In most cases, the users on either of the two remote systems would issue the commands, relieving some of the file permission problems.
<BR>
<BR>
<A NAME="E69E173"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Checking Transfers</B></FONT></CENTER></H4>
<BR>
<P>You can check on the status of transfers that are scheduled but haven't taken place yet by using the uustat command. When you issue the uustat command, all the UUCP transfers that are queued are listed. The format of the list is
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">jobID system user date command size</FONT></PRE>
<P>where jobID is the identification number of the UUCP job, system is the name of the system to transfer to (the first system in an address when multiple hops are taking place), user is the username who queued the job, date is when the job was queued, command is the exact command to be executed, and size is the size of the transfer in bytes.
<BR>
<P>If you issue the command as a user (not superuser), only your jobs are listed. The superuser lists all jobs that are queued. If you are logged in as a regular user and want to see all jobs, use the -a option:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uustat -a</FONT></PRE>
<P>To cancel a queued job, use the -k option of the uustat command along with the jobID. For example, to cancel jobID 17, issue the command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">uustat -k 17</FONT></PRE>
<P>You can only cancel your own jobs, unless you are logged in as superuser, in which case you can cancel any jobs.
<BR>
<BR>
<A NAME="E68E155"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>UUCP is quite easy to set up as long as you follow the rules. Once the configuration files are properly set, UUCP can transfer e-mail, news, and files to other systems. Using UUCP to transfer mail and files is as easy as using the usual mail and cp commands. Although UUCP is less popular nowadays because of the LAN craze, it does provide a simple, very low cost network for those who need to connect only a couple of machines. It's also great for connecting your machine to your friends' machines, allowing e-mail back and forth, and making your Linux system seem like a well-connected workstation.
<P ALIGN=LEFT>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -