684-687.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 110 行
HTML
110 行
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:UUCP</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=39//-->
<!--PAGES=684-687//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="681-684.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="687-689.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>The first line in the preceding extract is a comment line. Most system administrators like to put a comment line in to identify each system. The next lines identify the different aspects of the remote system, including its name (<TT>arthur</TT>), times at which it can be called (<TT>Any</TT> in this case, meaning no restrictions), the telephone number (including any area code or special digits that have to be dialed), the serial port to be used for the connection (in this case, <TT>com1</TT>), the speed at which to connect (9600 baud), and the chat script or login process. In this case, the chat script tells UUCP to wait until it sees the string <TT>login:</TT>, then to send <TT>merlin</TT>, wait for the prompt <TT>password:</TT>, and then send <TT>secret1</TT>.</P>
<P>Most login scripts require a login and password, and they must be placed in the configuration file because UUCP doesn’t allow interactive sessions. This can be a bit of a problem because it allows other users on your system to see the login password for the remote machine, but because it can only be used by UUCP, this is not a major concern. Also, the file permissions on the UUCP configuration files can be set to prevent any system users (other than <TT>root</TT>) from looking into the file.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Tip: </B><BR>Not all remote sites need a password for entry through UUCP. For example, some public archices let you log in and retrieve files using the uucp login with no password. Some sites use readily available passwords, such as uucp.<HR></FONT>
</BLOCKQUOTE>
<P>The port name used in the <TT>/usr/lib/uucp/sys</TT> entry does not have to match a device name on the Linux system because another file is used to match the entry to a physical device. This file is <TT>/usr/lib/uucp/port</TT>, and it requires an entry similar to this for a 9600 baud modem:</P>
<!-- CODE SNIP //-->
<PRE>
# com1 device port
port com1
type modem
device /dev/cua0
speed 9600
dialer Hayes
</PRE>
<!-- END CODE SNIP //-->
<P>In the <TT>/usr/lib/uucp/port file</TT>, the name of the port used in the <TT>/usr/lib/uucp/sys</TT> file is identified on the first line. The type of connection to be used (usually modem) is on the next. The actual Linux device that corresponds to the port name is specified as a device driver (for many Linux systems this can be <TT>/dev/modem</TT> which is linked to the serial port device driver).</P>
<P>The modem connection speed comes next and shows the maximum speed at which the modem can be used. Finally, the name of a dialer is entered. This is a throwback to the days when modems couldn’t dial themselves but used another device (called a <I>dialer</I>) to make the connection.</P>
<P>The dialer entry in the <TT>/usr/lib/uucp/port</TT> file is then matched to an entry in the file <TT>/usr/lib/uucp/dial</TT> which tells the modem how to dial the phone. Here’s a simple entry:</P>
<!-- CODE SNIP //-->
<PRE>
# Hayes modem
dialer Hayes
chat “” ATZ OK ATDT\T CONNECT
</PRE>
<!-- END CODE SNIP //-->
<P>This shows the script that the system uses to communicate to the Hayes modem. In this case, the <TT>\T</TT> in the command line is replaced with the telephone number to be called. Some Linux systems simplify the use of the <TT>/usr/lib/uucp/port</TT> and <TT>/usr/lib/uucp/dial</TT> files into one single entry in the <TT>/usr/lib/uucp/sys</TT> file, which names the modem file directly.</P>
<P>The remote end of the connection (in this case, the system <TT>arthur</TT>) must have corresponding entries for <TT>merlin</TT>. The files will be similar with only name, telephone number, and (possibly) device name and <TT>chat</TT> script changes. Until both ends are configured properly, you can’t get a connection between the two machines.</P>
<P>Some Linux systems with Taylor UUCP have a utility called <TT>uuchck</TT> that verifies the syntax in the UUCP configuration files and printout summary information. If you don’t have the <TT>uuchck</TT> utility, it can be downloaded from many FTP and BBS sites. Check Appendix A, “Linux FTP Sites and Newsgroups,” for some of the possible sites.</P>
<P>By default, Taylor UUCP allows a remote system to execute only a limited number of commands when they log into your system. Typically, the remote is only allowed to execute <TT>rmail</TT> and <TT>rnews</TT>, to transfer mail and news respectively. If you want to allow extra programs to be executed, add a line to the <TT>/usr/lib/uucp/sys</TT> file that includes all the commands the remote system can execute. For example, the following entry specifies that the system <TT>chatton</TT> can execute any of the four commands given after the <TT>commands</TT> keyword:</P>
<!-- CODE SNIP //-->
<PRE>
system chatton
….
commands rmail rnews rsmtp rdataupdate
</PRE>
<!-- END CODE SNIP //-->
<P>Note that all four commands must be in the usual search path used by the UUCP utilities (actually by <TT>uuxqt</TT>).</P>
<P>If you intend to transfer files between two machines, you must also modify the configuration files. When a remote system sends a file to your machine, the files should usually be stored in the directory <TT>/usr/spool/uucppublic</TT> (some systems use <TT>/var/spool/uucppublic</TT>) as a safety precaution. You don’t want to allow a remote system to write files anywhere on your file system or they could overwrite critical system files. The convention for most UUCP systems is to use either <TT>/usr/spool/uucppublic</TT> or <TT>/usr/spool/uucp/<I>system</I></TT> (in which <I>system</I> is the remote system’s name) as the transfer directories.</P>
<P>You can specify transfer and receive directories in the <TT>/usr/lib/uucp/sys</TT> file. For example, the following entry for the remote system <TT>chatton</TT> has been modified to include specific directories for file transfers:</P>
<!-- CODE SNIP //-->
<PRE>
system chatton
…
local-send ~/send
local-receive ~/receive
</PRE>
<!-- END CODE SNIP //-->
<P>In this configuration, the users on your local machine can send any file that is in the <TT>send</TT> directory under the <TT>uucp</TT> directory (<TT>~/send</TT>, which means that any file to be sent to a remote system must be transferred there first), and any file incoming from a remote system is stored in the <TT>receive</TT> directory under the <TT>uucp</TT> directory. If you want to allow transfers from a user’s home directory, you can specify the <TT>/usr</TT> directory as a starting point. Multiple entries are separated by spaces, so the following entry allows transfers from the <TT>send</TT> directory under the <TT>uucp</TT> directory or from any directory under<TT>/usr</TT>:</P>
<!-- CODE SNIP //-->
<PRE>
local-send ~/send /usr
</PRE>
<!-- END CODE SNIP //-->
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="681-684.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="687-689.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?