689-691.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 106 行
HTML
106 行
<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=689-691//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="687-689.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="691-693.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Permissions for file transfers are a little more convoluted with HDB UUCP than Taylor UUCP because HDB UUCP adds many features for special handling. Instead of looking at all the file transfer permissions, you are better off consulting a specialty book on UUCP because the subject can easily consume 100 pages by itself! For this reason, we’ll look at the fundamentals—just enough to get you set up properly.
</P>
<P>Permissions for remote system access and file transfers are handled by the file <TT>/usr/lib/uucp/Permissions</TT>. The general format of the entries in this file is</P>
<!-- CODE SNIP //-->
<PRE>
MACHINE=remotename LOGNAME=uucp \
COMMANDS=rmail:rnews:uucp \
READ=/usr/spool/uucppublic:/usr/tmp \
WRITE=/usr/spool/uucppublic:/usr/tmp \
SENDFILES=yes REQUEST=no
</PRE>
<!-- END CODE SNIP //-->
<P><TT>MACHINE</TT> identifies the remote machine’s name, <TT>LOGNAME</TT> is the name they use to log in (or you use to log in to their system), <TT>COMMANDS</TT> are the commands they can execute on your local system, <TT>READ</TT> is the list of directories they can read files from, <TT>WRITE</TT> is the list of directories where they can write files, <TT>SENDFILES</TT> means they can send files (yes or no), and <TT>REQUEST</TT> means they can request files from your system (yes or no). Notice the use of slashes at the end of the first four lines to indicate this is really a single long line broken up for readability. This is a typical UNIX convention.</P>
<P>A complete entry for the remote system <TT>wizard</TT> shows that it is allowed to both send and receive files but only from the <TT>/usr/spool/uucppublic</TT> directory, and it can only execute <TT>mail</TT> and <TT>uucp</TT> commands (the latter transfers files):</P>
<!-- CODE SNIP //-->
<PRE>
MACHINE=wizard LOGNAME=uucp1 \
COMMANDS=rmail: uucp \
READ=/usr/spool/uucppublic: \
WRITE=/usr/spool/uucppublic: \
SENDFILES=yes REQUEST=yes
</PRE>
<!-- END CODE SNIP //-->
<P>To prevent the remote system from sending files, change <TT>SENDFILES</TT> to no. To prevent the remote system from requesting files, change <TT>REQUEST</TT> to no.</P>
<H3><A NAME="Heading5"></A><FONT COLOR="#000077">A UUCP Connection</FONT></H3>
<P>When UUCP connects to a remote machine, it follows a particular series of steps. You can better understand the configuration files used by UUCP and the processes that are involved by following through a typical session. UUCP uses a process called <TT>uucico</TT> (UUCP Call In/Call Out) to handle the process of connecting and sending information. A UUCP connection can be started with the <TT>uucico</TT> command followed by the remote system name, such as</P>
<!-- CODE SNIP //-->
<PRE>
uucico -s arthur
</PRE>
<!-- END CODE SNIP //-->
<P>When <TT>uucico</TT> starts, it examines the <TT>/usr/lib/uucp/sys</TT> file (Taylor UUCP) or <TT>/usr/lib/uucp/Systems</TT> (HDB UUCP) to see if the remote system name exists there. When it finds the proper remote system name, <TT>uucico</TT> reads the rest of the entries for that system, including the port to be used. From there, <TT>uucico</TT> uses <TT>/usr/lib/uucp/port</TT> and <TT>/usr/lib/uucp/dial</TT> (Taylor UUCP) or <TT>/usr/lib/uucp/Devices</TT> and <TT>/usr/lib/uucp/Dialers</TT> (HDB UUCP) to start the modem connection (assuming it is a modem used to establish the session, of course). When the modem is in use, <TT>uucico</TT> creates a lock on the device so no other application can use it (the lock is a file starting with <TT>LCK..</TT> and followed by the device name, such as <TT>LCK..cua0</TT>).</P>
<P>Once the <TT>chat</TT> scripts for setting up and dialing the modem have been executed and the remote system is connected, <TT>uucico</TT> uses the <TT>chat</TT> script in the <TT>/usr/lib/uucp/sys</TT> or <TT>/usr/lib/uucp/Systems</TT> file to log in to the remote. Once logged in, the remote machine starts its copy of <TT>uucico</TT>, and the two <TT>uucico</TT> processes establish handshaking between themselves. Finally, after the handshaking has been established, <TT>uucico</TT> goes ahead and handles any transfers that are queued.</P>
<P>When completed with the session, the local machine checks to make sure that the remote has nothing further to send and then breaks the connection. Finally, <TT>uucico</TT> terminates.</P>
<H3><A NAME="Heading6"></A><FONT COLOR="#000077">Direct Connections</FONT></H3>
<P>If your two machines are directly connected through a serial port, for example (no modems involved in the connection), you can use UUCP as a simple network protocol for file transfer. The only changes to the configuration files mentioned earlier are in the port specification. Instead of using a modem device, you specify a direct connection. For example, in the <TT>/usr/lib/uucp/sys</TT> file (Taylor UUCP), create an entry like this:</P>
<!-- CODE SNIP //-->
<PRE>
port direct1
</PRE>
<!-- END CODE SNIP //-->
<P>Include a matching entry in the <TT>/usr/lib/uucp/port</TT> file that looks like this:</P>
<!-- CODE SNIP //-->
<PRE>
port direct1
type direct
speed 38400
device /dev/cua1
</PRE>
<!-- END CODE SNIP //-->
<P>Specify the speed of the direct connection and the port which uses it. The entries in the HDB UUCP version are similar, using the <TT>/usr/lib/uucp/Systems</TT> and <TT>/usr/lib/uucp/Devices</TT> files.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="687-689.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="691-693.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?