📄 lsg27.htm
字号:
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting Up Remote Systems</B></FONT></CENTER></H4>
<BR>
<P>You also need to provide information about the remote system you want to connect to. The /usr/lib/uucp/sys file holds all the information about remote systems. This file usually has a few sample entries in it that you can copy or modify. Don't leave comment marks (pound or hash marks) in the first column or the entries will be ignored. A /usr/lib/uucp/sys entry for the remote machine arthur looks like the following:
<BR>
<PRE>
<FONT COLOR="#000080"># system: arthur (Bill Smallwood's Linux system)
system arthur
time Any
phone 555-1212
port com1
speed 9600
chat login: merlin password: secret1</FONT></PRE>
<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 (arthur), times at which it can be called (Any 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, com1), 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 login:, and then send merlin. Then UUCP waits for the prompt password: and sends secret1.
<BR>
<P>Most login scripts require a login and password, and you must place these items in the configuration file because UUCP doesn't allow interactive sessions. This requirement 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 only UUCP can use this password, this problem is not a major concern. Also, you can set the file permissions on the UUCP configuration files to prevent any system users (other than root) looking into the file.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Not all remote sites need a password for entry through UUCP. For example, some public archives let you log in and retrieve files using the uucp login with no password. Other sites use readily available passwords, such as uucp.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E69E163"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Ports and Modems</B></FONT></CENTER></H4>
<BR>
<P>The port name used in the /usr/lib/uucp/sys entry does not have to match a device name on the Linux system because the file /usr/lib/uucp/port is used to match the entry to a physical device. This file requires an entry similar to the following for a 9600 baud modem:
<BR>
<PRE>
<FONT COLOR="#000080"># com1 device port
port com1
type modem
device /dev/cua0
speed 9600
dialer Hayes</FONT></PRE>
<P>In the /usr/lib/uucp/port file, the name of the port used in the /usr/lib/uucp/sys file is identified on the first line. The type of connection to be used (usually modem) is on the next. The Linux device that corresponds to the port name is specified as a device driver (for many Linux systems this driver can be /dev/modem, which is linked to the serial port device driver).
<BR>
<P>The modem connection speed comes next, and it shows the maximum speed of the modem. Finally, the name of a dialer is entered. This parameter is a throwback to the days when modems couldn't dial themselves and used another device (called a dialer) to make the connection. The dialer entry in the /usr/lib/uucp/port file is then matched to an entry in the file /usr/lib/uucp/dial, which tells the modem how to dial the phone. Here's a sample entry:
<BR>
<PRE>
<FONT COLOR="#000080"># Hayes modem
dialer Hayes
chat "" ATZ OK ATDT\T CONNECT</FONT></PRE>
<P>This entry shows the script that the system uses to communicate to the Hayes modem. In this case, the \T in the command line is replaced with the telephone number to be called. Some Linux system combine the /usr/lib/uucp/port and /usr/lib/uucp/dial files into a single entry in the /usr/lib/uucp/sys file that names the modem file directly.
<BR>
<P>The remote end of the connection (in this case, the system arthur) must have corresponding entries for merlin. The files are similar with only name, telephone number, and (possibly) device name and chat script changed. Until both ends are configured properly, you can't get a connection between the two machines. Some Linux systems with Taylor UUCP have a utility called uuchk that verifies the syntax in the UUCP configuration files and prints out summary information. If you don't have the uuchk utility, you can download it from many FTP and BBS sites.
<BR>
<BR>
<A NAME="E69E164"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Access Permissions</B></FONT></CENTER></H4>
<BR>
<P>By default, Taylor UUCP allows a remote system to execute only a limited number of commands when it logs into your system. Typically, the remote is only allowed to execute rmail and rnews to transfer mail and news respectively. If you want to allow extra programs to be executed, add a line to the /usr/lib/uucp/sys file that includes all the commands the remote system can execute. For example, the entry
<BR>
<PRE>
<FONT COLOR="#000080">system chatton
....
commands rmail rnews rstmp rdataupdate</FONT></PRE>
<P>specifies that the system chatton can execute any of the four commands given after the commands keyword. Note that all four commands must be in the usual search path used by the UUCP utilities (actually by uuxqt).
<BR>
<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 usually should be stored in the directory /usr/spool/uucppublic (some systems use /var/spool/uucppublic) as a safety precaution. You don't want to allow a remote system to write files anywhere on your filesystem, or it could overwrite critical system files. The convention for most UUCP systems is to always use /usr/spool/uucppublic as the transfer directory.
<BR>
<P>You can specify transfer and receive directories in the /usr/lib/uucp/sys file. For example, the following entry for the remote system chatton has been modified to include specific directories for file transfers:
<BR>
<PRE>
<FONT COLOR="#000080">system chatton
...
local-send ~/send
local-receive ~/receive</FONT></PRE>
<P>In this configuration, the users on your local machine can send any file that is in the /send directory under the UUCP directory (~/send, 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 receive directory under the UUCP directory. If you want to allow transfers from a user's home directory, you can specify the /usr directory as a starting point. Multiple entries are separated by spaces, so the entry
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">local-send ~/send /usr</FONT></PRE>
<P>allows transfers from the /send directory under the UUCP directory or from any directory under /usr.
<BR>
<P>The preceding two lines deal only with file transfers requested or sent from your machine. If you want to enable requests for transfers from the remote machine, you need to add two more lines:
<BR>
<PRE>
<FONT COLOR="#000080">remote-send /usr/lib/uucppublic
remote-request /usr/lib/uucppublic</FONT></PRE>
<P>These lines force the remote machine to request files and send them only to the /usr/lib/uucppublic directory. Again, you can offer several choices if you want, as long as they are separated by spaces.
<BR>
<P>Finally, UUCP allows machines to forward data through other machines, a process called <I>hopping</I>. In other words, if you want to send mail to the system warlock but can only get there through the system wizard, you have to instruct UUCP that your local system can get to warlock through wizard by adding a forward command to the /usr/lib/uucp/sys file:
<BR>
<PRE>
<FONT COLOR="#000080">system wizard
...
forward warlock</FONT></PRE>
<P>You should then add an entry for the warlock system that tells UUCP that any mail for you will be coming back through wizard:
<BR>
<PRE>
<FONT COLOR="#000080">system warlock
...
forward-to merlin</FONT></PRE>
<P>The forward-to command ensures that any files returned by warlock are passed to merlin, the local host machine. Otherwise, UUCP would discard these files for not being routable. By default, Taylor UUCP does not allow forwarding, and most system administrators should think carefully about allowing it as the potential for abuse is high.
<BR>
<BR>
<A NAME="E68E151"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Configuring HDB UUCP</B></FONT></CENTER></H3>
<BR>
<P>HDB UUCP is a more recent version of UUCP and its configuration files are different from Taylor UUCP. In many ways, the HDB configuration is easier than the Taylor UUCP configuration, although neither is difficult once you know the basic process. Instead of setting the name of the local system in the UUCP configuration files, you use the hostname command (see <A HREF="lsg17.htm">Chapter 17</A>, "System Names and Access Permissions").
<BR>
<BR>
<A NAME="E69E165"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Specifying Remote Systems</B></FONT></CENTER></H4>
<BR>
<P>The names of the remote systems are stored in the file /usr/lib/uucp/Systems (some older versions used the name /usr/lib/uucp/L.sys). Each remote system that will be connected to the local system has a single line. The format of each line is
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">sitename schedule device_type speed phone login_script</FONT></PRE>
<P>where sitename is the name of the remote machine, schedule is when the machine can be connected to the local system, device_type is the type of device used to call the remote system, speed is the speed (or range of speeds) that you can use to connect to the remote system, phone is the telephone number of the remote system, and login_script is the script used when a connection is made (like the chat script in Taylor UUCP). For example, to call the remote system arthur, the /usr/lib/uucp/Systems file has a line like the following:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">arthur Any ACU 9600 555-1212 login: uucp password: secret1</FONT></PRE>
<P>The Any entry in the schedule field tells UUCP that it can call at any time. The ACU entry in the device_type field tells UUCP to use the ACU (automatic calling unit) defined in the /usr/lib/uucp/Devices file.
<BR>
<BR>
<A NAME="E69E166"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting the Modem Device</B></FONT></CENTER></H4>
<BR>
<P>The /usr/lib/uucp/Devices file (or /usr/lib/uucp/L-devices file in some older versions) contains information about the devices (usually modems) that you can use to call the remote systems. The Devices file follows this syntax
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">devicetype ttyline dialerline speed dialer [token Dialer ...]</FONT></PRE>
<P>where devicetype is the name of the device (which should match the device name in the /usr/lib/uucp/Systems file), ttyline is the device driver to be used for the connecting port (usually a serial line, such as /dev/tty2a or /dev/modem), dialerline is an obsolete field left as a hyphen, speed is the speed range of the device, and dialer is the name of the file that tells UUCP how to use the device. A sample line for a Hayes 9600 baud modem used to connect on the second serial port of the system might have an entry in the /usr/lib/uucp/Devices file like the following:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">ACU tty2A - 9600 dialHA96</FONT></PRE>
<P>This entry identifies the ACU entry as a 9600 baud connection through /dev/tty2A (the /dev portion of the name is not needed with HDB UUCP), and it uses a program called dialHA96 to handle the setup and dialing of the modem. Most popular modems usually have programs available that set the modem configuration parameters automatically, leaving Linux out of that process. If a program is not available to handle the modem, you can use an entry in the file /usr/lib/uucp/Dialers. The format of the Dialers entries is
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">dialer translation expect send ...</FONT></PRE>
<P>where dialer is the name of the dialer (matching the Devices file), translation is the translation table to use for the phone number (converting characters where needed to pauses, beeps, and so on), and the expect and send entries are the chat script to set up the modem. A sample line in the Dialers file looks like the following:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">hayes1200 =,-, "" AT\r\c OK\r \EATDT\T\r\c CONNECT</FONT></PRE>
<P>This entry is for a Hayes 1200 Smartmodem, identified by the name hayes1200, with translations for the = and - characters, followed by the AT commands used to set up the modem. These entries are usually supplied in the Dialers file for most popular modems.
<BR>
<BR>
<A NAME="E69E167"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting Access Permissions</B></FONT></CENTER></H4>
<BR>
<P>Permissions for file transfers are a little more convoluted with HDB UUCP than Taylor UUCP, as HDB UUCP adds many features for special handling. This section gives you the fundamentals you need to set up properly. For more detailed information, consult a specialty book on UUCP; the subject can easily consume 100 pages by itself!
<BR>
<P>The file /usr/lib/uucp/Permissions handles permissions for remote system access and file transfers. The general format of the entries in this file is
<BR>
<PRE>
<FONT COLOR="#000080">MACHINE=remotename LOGNAME=uucp \
COMMANDS=rmail:rnews:uucp \
READ=/usr/spool/uucppublic:/usr/tmp \
WRITE=/usr/spool/uucppublic:/usr/tmp \
SENDFILES=yes REQUEST=no</FONT></PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -