📄 unx08.htm
字号:
<HTML>
<HEAD>
<TITLE>UNIX Unleashed unx08.htm</TITLE>
<LINK REL="ToC" HREF="index.htm">
<LINK REL="Next" HREF="unx09.htm">
<LINK REL="Previous" HREF="unx07.htm"></HEAD>
<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>
<P><A HREF="unx07.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="unx09.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>
</P><UL>
<LI>
<A HREF="#I1">8</A></LI>
<UL>
<LI>
<A HREF="#I3">Getting Around the Network</A></LI>
<UL>
<UL>
<UL>
<LI>
<A HREF="#I4">By Rachel and Robert Sartin</A></LI></UL></UL>
<LI>
<A HREF="#I5">What Is a Network?</A></LI>
<UL>
<LI>
<A HREF="#I6">UUCP—The Basic Networking Utilities</A></LI>
<LI>
<A HREF="#I7">TCP/IP—LAN, WAN, and the Internet</A></LI>
<LI>
<A HREF="#I8">Names and Addresses</A></LI>
<UL>
<LI>
<A HREF="#I9">What's in a Name?</A></LI>
<LI>
<A HREF="#I10">Using Shorter Names</A></LI>
<LI>
<A HREF="#I11">Decoding Addresses and Ports</A></LI>
<LI>
<A HREF="#I12">Converting Names to Addresses</A></LI>
<LI>
<A HREF="#I13">A Brief Introduction to NIS</A></LI></UL></UL>
<LI>
<A HREF="#I14">I'm on the Wire—rlogin, telnet, cu</A></LI>
<UL>
<LI>
<A HREF="#I15">Before Using rlogin, rsh, and rcp</A></LI>
<LI>
<A HREF="#I16">Using rlogin</A></LI>
<UL>
<LI>
<A HREF="#I17">Establishing an rlogin Connection</A></LI>
<LI>
<A HREF="#I18">Failed Connect</A></LI>
<LI>
<A HREF="#I19">Using the Remote Login Session</A></LI>
<LI>
<A HREF="#I20">Using the Escape Character</A></LI></UL>
<LI>
<A HREF="#I21">Using Telnet</A></LI>
<UL>
<LI>
<A HREF="#I22">open</A></LI>
<LI>
<A HREF="#I23">close</A></LI>
<LI>
<A HREF="#I24">quit</A></LI>
<LI>
<A HREF="#I25">set</A></LI>
<LI>
<A HREF="#I26">?</A></LI></UL>
<LI>
<A HREF="#I27">Before Using cu</A></LI>
<LI>
<A HREF="#I28">Using cu</A></LI></UL>
<LI>
<A HREF="#I29">Transferring Files—rcp, ftp, uucp</A></LI>
<UL>
<LI>
<A HREF="#I30">Using rcp</A></LI>
<UL>
<LI>
<A HREF="#I31">Specifying a Remote File</A></LI>
<LI>
<A HREF="#I32">Understanding the rcp Command Line Syntax</A></LI></UL>
<LI>
<A HREF="#I33">Using ftp</A></LI>
<UL>
<LI>
<A HREF="#I34">Connection-Related Commands</A></LI>
<LI>
<A HREF="#I35">File Transfer—Related Commands</A></LI>
<LI>
<A HREF="#I36">File- and Directory-Management Commands</A></LI>
<LI>
<A HREF="#I37">Miscellaneous Commands</A></LI>
<LI>
<A HREF="#I38">Configuring with .netrc</A></LI>
<LI>
<A HREF="#I39">Anonymous ftp</A></LI></UL>
<LI>
<A HREF="#I40">Using uucp, uuto, and uupick</A></LI>
<UL>
<LI>
<A HREF="#I41">uucp</A></LI>
<LI>
<A HREF="#I42">uuto and uupick</A></LI></UL></UL>
<LI>
<A HREF="#I43">Other Networking Services</A></LI>
<UL>
<LI>
<A HREF="#I44">archie</A></LI>
<LI>
<A HREF="#I45">gopher</A></LI>
<LI>
<A HREF="#I46">WorldWide Web</A></LI></UL>
<LI>
<A HREF="#I47">Troubleshooting TCP/IP</A></LI>
<UL>
<LI>
<A HREF="#I48">nslookup to Check Address Mapping</A></LI>
<LI>
<A HREF="#I49">Is There Anybody Out There? (ping)</A></LI></UL>
<LI>
<A HREF="#I50">Summary</A></LI></UL></UL></UL>
<H1 ALIGN="CENTER">
<CENTER><A ID="I1" NAME="I1">
<BR>
<FONT SIZE=5><A ID="I2" NAME="I2"></A><B>8</B>
<BR></FONT></A></CENTER></H1>
<H2 ALIGN="CENTER">
<CENTER><A ID="I3" NAME="I3">
<FONT SIZE=5><B>Getting Around the Network</B>
<BR></FONT></A></CENTER></H2>
<H5 ALIGN="CENTER">
<CENTER><A ID="I4" NAME="I4">
<FONT SIZE=3><B>By Rachel and Robert Sartin</B>
<BR></FONT></A></CENTER></H5>
<P>The "information superhighway" has received a lot of attention recently. Much of this "network of the future" is with us today. This chapter introduces you to the basic UNIX software that is used today to connect hundreds of
thousands of machines together in the Internet and USENET.
<BR></P>
<P>Connecting machines in a network gives you even more computing and information resources than you can get from simply having a computer at your desk or in your computing center. With a network of machines connected together, you will be able to share
data files with co-workers, send electronic mail, play multiuser games with people from all over the world, read USENET news articles, contribute to worldwide discussions, perform searches for software or information you need, and much more. In this
chapter you will learn about the two most common ways to connect UNIX machines together in a network: UUCP and TCP/IP. On this simple base exists a worldwide network of machines and services that has the potential to greatly increase your productivity. By
learning to use these services effectively, you will open the door to new possibilities using your computer. This chapter only begins to probe the extent of available software and resources. Please refer to the Sams Publishing book Internet Unleashed for
even more information on this topic.
<BR></P>
<H3 ALIGN="CENTER">
<CENTER><A ID="I5" NAME="I5">
<FONT SIZE=4><B>What Is a Network?</B>
<BR></FONT></A></CENTER></H3>
<P>A network is a system of two or more computers connected to one another. In this chapter you will learn about some of the common ways to network UNIX machines together. At the simplest end of the scale, a network can be two UNIX machines connected to
each other using a serial line (typically through a modem) and running UUCP, the UNIX-to-UNIX Copy Program. More complicated network configurations run TCP/IP, the Transfer Control Protocol/Internet Protocol, the common name for the protocol family used on
the Internet, a collection of networks that allows you to connect your computer to hundreds of thousands of other computers.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I6" NAME="I6">
<FONT SIZE=3><B>UUCP—The Basic Networking Utilities</B>
<BR></FONT></A></CENTER></H4>
<P>Early in the history of UNIX, it became apparent that it would be advantageous to connect UNIX machines so that they could share some resources. One of the attempts to connect machines together resulted in the UUCP protocol, which allows you to connect
two UNIX machines to each other using a serial line (often with a modem attached). The primary focus of UUCP is to allow files to be copied between two UNIX machines, but there are services built on top of UUCP that allow execution of certain commands,
such as news and mail commands, thus enabling more sophisticated processing. You can use UUCP to send electronic mail between two UNIX machines and to transmit and receive USENET news articles. The most common release of UUCP available now is often called
either BNU, the Basic Networking Utilities—the System V version of UUCP, or HoneyDanBer (HDB). There are other freely available and commercial implementations of UUCP. Although UUCP originated on UNIX and was designed specifically for copying between
UNIX machines, there are now versions of UUCP that run on MS-DOS and other platforms.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> Just in case your UNIX machine does not include UUCP, there is a freely available version of UUCP (Taylor UUCP) on the CD-ROM. You can build this version on your UNIX machine and it will interoperate
with HDB UUCP.
<BR></NOTE>
<HR ALIGN=CENTER>
<H4 ALIGN="CENTER">
<CENTER><A ID="I7" NAME="I7">
<FONT SIZE=3><B>TCP/IP—LAN, WAN, and the Internet</B>
<BR></FONT></A></CENTER></H4>
<P>In the 1970s, the United States Department of Defense began a research program called DARPA, the Defense Advanced Research Projects Administration. One of the efforts of DARPA was to create an Internet, an interconnected set of networks, that would
allow research labs across the country to interact. This network was called the ARPAnet and the protocol that ran the interconnections was and is called IP, or Internet Protocol. Since the original ARPAnet, internetworking has grown incredibly and there is
now a huge and difficult-to-define thing called the Internet that allows interconnections between computers all over the world. The Internet includes hundreds of thousands of machines (because of the amorphous nature of the Internet, it is difficult even
to get an accurate count) connected through a series of public and private networks.
<BR></P>
<P>The Internet Protocol allows the sending of packets between any two computers that are connected to the Internet. IP supplies only a primitive service and further levels of protocol exist that use IP to perform useful functions. Two very common
protocols are TCP/IP and UDP/IP. TCP/IP connects two programs in much the same way a serial line connects two computers. UDP/IP, the User Datagram Protocol/IP, supplies a simple way of sending short messages between two programs. Most interesting user
programs that use IP networking use TCP to create a connection, so "TCP/IP" is often used to refer to the interconnection protocol on the Internet.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I8" NAME="I8">
<FONT SIZE=3><B>Names and Addresses</B>
<BR></FONT></A></CENTER></H4>
<P>To use machines and resource on the network, you need to locate them. Hostnames use a hierarchical naming space that allows each hostname to be unique, without forcing it to be obscure or unpronounceable. For example, ftp.uu.net is the name of one host
on the Internet. IP itself uses Internet addresses, unique identifiers of Internet hosts, which are usually written in dot notation, four numbers (each between 0 and 255), separated by periods. For example, 192.48.96.9 is the address (as of this writing)
of the host ftp.uu.net, which is covered in the section "Transferring Files—rcp, ftp, uucp."
<BR></P>
<H5 ALIGN="CENTER">
<CENTER><A ID="I9" NAME="I9">
<FONT SIZE=3><B>What's in a Name?</B>
<BR></FONT></A></CENTER></H5>
<P>Hostnames on the Internet are a series of "words" separated by periods, or dots. The dots separate different parts of the name. The naming system used is called the domain naming system (DNS) because it separates responsibility for unique
names into administrative domains. The administrator of each domain is responsible for managing and assigning unique names within that domain. The management of the top-level or root domain, the extreme right word in a hostname, is responsible for the
naming conventions. The best way to understand hostnames is to start out by reading them right to left, one word at a time. See Figure 8.1 for a sketch of the hierarchical name space used in these examples.
<BR></P>
<P>
<BR><B><A HREF="08unx01.gif">Figure 8.1. A tree of hostnames.</A></B>
<BR></P>
<P>Look at the hostname ftp.uu.net. Reading right to left, the first word is net, which means that the hostname is a network service provider; see Table 8.1 for explanations of this and other top-level names. The next word is uu. Within .net, uu belongs to
UUNET Communications, a company that supplies networking services. Elsewhere in the domain naming space, the name uu may mean something else.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -