⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0275-0277.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:


<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:TCP/IP Network Management</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311739 //-->

<!-- TITLE=RED HAT LINUX 2ND EDITION //-->

<!-- AUTHOR=DAVID PITTS ET AL //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS PUBLISHING //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=13 //-->

<!-- PAGES=0243-0298 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0272-0274.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0278-0280.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-275"><P>Page 275</P></A>









<P>The first column indicates the file in question. In the first line, this is

passwd. The next column indicates the source for the file. This can be one of six options:

</P>



<TABLE WIDTH="360">

<TR><TD>

<B>Option</B>

</TD><TD>

<B>Description</B>

</TD></TR>

<TR><TD>

nis

</TD><TD>

Uses NIS to determine this information.

</TD></TR>

<TR><TD>

yp

</TD><TD>

Uses NIS to determine this information (alias for

nis).

</TD></TR>

<TR><TD>

dns

</TD><TD>

Uses DNS to determine this information (applicable

only to hosts).

</TD></TR>

<TR><TD>

files

</TD><TD>

Uses the file on the local machine to determine

this information (for example, /etc/passwd).

</TD></TR>

<TR><TD>

[NOTFOUND=return]

</TD><TD>

Stops searching if the information has not been found yet.

</TD></TR>

<TR><TD>

nis+

</TD><TD>

Uses NIS+. (You won't use this because of the

incomplete support for NIS+ under Linux.)

</TD></TR>

</TABLE>











<P>The order these are placed in the

/etc/nsswitch.conf file determines the search order used

by the system. For example, in the hosts line, the order of the entries are files

nis dns, indicating that hostnames are first searched for in the

/etc/hosts file, then via NIS in the map

hosts.byname, and finally by DNS via the DNS server specified in

/etc/resolv.conf.

</P>









<P>In almost all instances, you want to search the local file before searching through NIS or

DNS. This allows a machine to have local characteristics (such as a special user listed in

/etc/passwd) while still using the network services being offered. The notable exception to this is the

netgroup file that by its very nature should come from NIS.

</P>









<P>Modify the order of your searches to suit your site's needs and save the configuration file.

</P>



<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

NOTE

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

If you are familiar with NIS from an older version of Linux or another UNIX altogether,

you might be wondering why I haven't mentioned the

ypbind daemon.

<BR>

Red Hat's standard C library comes with the NIS resolver built into it. This allows for

NIS functions to work without the need of an extra daemon on the client workstation. A

side effect of this is that the ypwhich program, which normally states which NIS server is

being used, does not work. While it's a slight nuisance, you can still test the configuration

with ypcat, as you will see shortly.

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

<BR>



<P>Because of the way NIS works under Red Hat, you do not need to reboot in order to start

NIS client functions. By simply running

</P>





<!-- CODE SNIP //-->

<PRE>

domainname `cat /etc/domainname'

</PRE>

<!-- END CODE SNIP //-->











<P>you can establish a connection to the NIS server and test your client software without

having to reboot.

</P>



<A NAME="PAGENUM-276"><P>Page 276</P></A>













<P>As a precautionary measure, you should schedule a reboot while you are with the machine

to ensure that it does come up and configure the NIS information correctly. After all, your

users will not be very happy if after a power failure, your machine does not come back up

correctly without assistance.

</P>









<P>With the NIS client and server configured, you are ready to test your work. Try the following:

</P>





<!-- CODE SNIP //-->

<PRE>

ypcat passwd

</PRE>

<!-- END CODE SNIP //-->











<P>If your configuration is working, you should see the contents of your NIS server's

/etc/passwd.yp file displayed on your screen. (Assuming, of course, that you chose that file to be shared

via NIS for your passwd file.) If you received a message such as

</P>





<!-- CODE SNIP //-->

<PRE>



No such map passwd.byname. Reason: can't bind to a server which serves domain



</PRE>

<!-- END CODE SNIP //-->











<P>you need to go back and double-check that your files have been properly configured.

</P>



<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

TIP

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

A difference between the NIS that comes with Red Hat and other UNIXes' NIS packages

is that Red Hat does not need the /etc/passwd file to have the string

+:*:0:0::: appended to it. You might, however, want to add that anyway because the finger daemon,

fingerd, does need that line in order to check NIS maps for

user information.

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

<BR>



<H4>

Configuring an NIS Secondary Server

</H4>









<P>After you've decided to configure a machine to be an NIS secondary server, you need to

start by configuring it as an NIS client machine. Verify that you can access the server maps via

the ypcat command.

</P>









<P>Begin configuring the secondary server by installing the

ypserv RPM from either <a href="http://www.redhat.com">http://www.redhat.com</A> or from the CD-ROM (filename

ypserv-1.1.7-1.i386.rpm).

</P>









<P>When you have the ypserv program installed, go ahead and start it up by running

/etc/rc.d/init.d/ypserv.init start. It isn't doing anything useful yet, but you will need to have it

running shortly.

</P>









<P>Next, either download ypbind-3.0-1.src.rpm from

<a href="http://www.redhat.com">http://www.redhat.com</A> or copy it from the CD-ROM. After it's installed, you will need to compile it as follows:

</P>









<OL>

<LI> Go to the directory

     /usr/src/redhat/SOURCES and run tar -xvzf

     ypbind-3.0.tar.gz. This will uncompress and untar the archive into the

     /usr/src/redhat/SOURCES/ypbind directory.



<LI> Type cd ypbind to go into the

     ypbind directory. You are now ready to apply the

     patch that came with the distribution. Type patch &lt;

     ../ypbind-3.0-glibc.diff to apply the patch.

</OL>







<A NAME="PAGENUM-277"><P>Page 277</P></A>











<OL START=3>

<LI>  The Makefile distributed with this package assumes you use the

      nsl libraries. Red Hat doesn't use this library, so you need to remove it from the

      Makefile by running the following: mv Makefile Makefile.nsl;grep -v nsl Makefile.nsl &gt;

      Makefile.



<LI>  Run make to build the distribution. Ignore any warnings about

      `rcsid' defined but not used. When it is completed, you should have the

      ypbind binary in the current directory.



<LI>  Copy the ypbind binary to the

      /usr/lib/yp directory and be sure its permissions

      are set to 0700.



<LI>  Start ypbind on the client machine and test it by running

      ypwhich -m. It should list all of the maps being served from the current NIS master.

</OL>









<P>If you remember the details on NIS clients, you might remember not needing

ypbind because it is built into the resolver library under Red Hat Linux. However, the

ypinit program that you'll be using soon requires it in order to communicate with the master server.

ypbind will not become part of the startup sequence.

</P>









<P>Now you are ready to tell the master server that a slave server exists. To do this, edit the

/var/yp/ypservers file so that the slave server you are setting up is included in the list. If you

configured your master server with the name of the slave server during the

ypinit -m phase, you do not need to do this.

</P>









<P>Although ypbind will not be part of startup, you do need to make a small change in the

startup sequence in order to set the NIS domain name. This is done by editing the

/etc/sysconfig/network file and adding the line

NIS_DOMAIN=nisdomain.com where nisdomain.com is your

NIS domain name. In the sample network, this would be

audionet.domain.com.

</P>









<P>In order to set the domain name without having to reboot for the purpose

of installing the NIS slave server, set the NIS domain name explicitly by using the

domainname command, such as

</P>





<!-- CODE SNIP //-->

<PRE>

domainname nisdomain.com

</PRE>

<!-- END CODE SNIP //-->











<P>where nisdomain.com is the NIS domain name of your choice.

</P>









<P>You can now initialize the slave server by running the command

</P>





<!-- CODE SNIP //-->

<PRE>

/usr/lib/yp/ypinit -s master

</PRE>

<!-- END CODE SNIP //-->











<P>where master is the hostname for the NIS master server. In this example, it's

vestax. The output of this should look something like the following:

</P>





<!-- CODE //-->

<PRE>

We will need some minutes to copy the databases from vestax.

Transferring mail.aliases...

Trying ypxfrd ... not running

Transferring services.byname...

Trying ypxfrd ... not running

Transferring rpc.bynumber...

Trying ypxfrd ... not running

[etc...]

</PRE>

<!-- END CODE //-->







<P><CENTER>

<a href="0272-0274.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0278-0280.html">Next</A>

</CENTER></P>









</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -