<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technical Diary &#187; nis</title>
	<atom:link href="http://andriigrytsenko.net/tag/nis/feed/" rel="self" type="application/rss+xml" />
	<link>http://andriigrytsenko.net</link>
	<description>With Andrii Grytsenko</description>
	<lastBuildDate>Tue, 17 Aug 2010 08:25:33 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>NIS and RedHat Linux Mini-HOWTO</title>
		<link>http://andriigrytsenko.net/2009/07/nis-for-redhat-mini-howto/</link>
		<comments>http://andriigrytsenko.net/2009/07/nis-for-redhat-mini-howto/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 10:22:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nis]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=302</guid>
		<description><![CDATA[Here is describe how to configure NIS for the RedHat Linux.

The Network Information Service or NIS (originally called Yellow Pages or YP) consists of a client-server directory service protocol for distributing system configuration data such as user and host names between computers on a computer network.
Before we start  I would like to say couple [...]]]></description>
			<content:encoded><![CDATA[<p>Here is describe how to configure NIS for the RedHat Linux.</p>
<p><span id="more-302"></span></p>
<p>The Network Information Service or NIS (originally called Yellow Pages or YP) consists of a client-server directory service protocol for distributing system configuration data such as user and host names between computers on a computer network.</p>
<p>Before we start  I would like to say couple words about my environment:<br />
- I have to boxes (node2 has ip address 10.0.30.2 and node1 with ip 10.0.30.1)<br />
- node2 used as NIS server and node1 as NIS client<br />
- Both machines uses CentOS</p>
<p>I will divide post on two part. First part will be describe what have to done on the server side and second on the client side.</p>
<p>Let&#8217;s get nis software over yum:</p>
<pre>yum install ypbind
yum install ypserv
yum install yp-tools</pre>
<p>And configure ypserv configuration files:</p>
<pre>vi /etc/ypserv.conf</pre>
<p>The main line is :<br />
<em>Host : Domain : Map : Security </em> , it&#8217;s commented by default<br />
In our server we have next lines:</p>
<pre>10.0.30. : my-net : * : port </pre>
<p>It&#8217;s means that:<br />
- we allow access to our database all machines in subnet 10.0.30.0/24 .<br />
- the name of our nis domain is <em>&#8220;my-net&#8221;</em><br />
- we allow for replicate all files which described at /var/yp/Makefile<br />
- allow access if source port &lt; 1024. Otherwise deny access.</p>
<p>If you want to get more information concerning ypserv.conf, type:</p>
<pre>man ypserv.conf </pre>
<p>Do not forget set variable NISDOMAIN at file /etc/syconfig/network, because your service will not start at next boot:</p>
<pre>echo "NISDOMAIN=\"my_net\"" &gt;&gt; /etc/syconfig/network</pre>
<p>Start server services :</p>
<pre>/etc/init.d/ypserv start
/etc/init.d/yppasswdd start</pre>
<p>and add its to loading scripts :</p>
<pre>chkconfig --level 345 ypserv on
chkconfig --level 345 yppasswdd on</pre>
<p>Where ,<br />
ypserv &#8211; main server<br />
yppasswdd &#8211; password daemon, which allows users change their password in NIS database</p>
<p>Also you need to create <em>/var/yp/securenets</em> file restrict access to your NIS server. To allow acces for subnet 10.0.30.0/24, put next in file:</p>
<pre>255.255.255.0   10.0.30.0</pre>
<p>Use
<pre>man securenets</pre>
<p> to get more details.</p>
<p>Next, generate nis database :</p>
<pre>cd /usr/lib/yp/
./ypinit -m </pre>
<p>you will be prompted to input the name of client servers(they should be declared at <em>/etc/hosts</em>)</p>
<p>Make these steps every time after updating of maped files:</p>
<pre>cd /var/yp/
make </pre>
<p>That all for the first part. Now your server should be work.</p>
<p>Go to the client side.</p>
<p>Install nis client software:</p>
<pre>yum install ypbind</pre>
<p>and switch off SELinux rule which block ypbind running:</p>
<pre># setsebool -P allow_ypbind on</pre>
<p>Edit /etc/yp.conf file. Put into it next string:</p>
<pre>domain my_net server node2</pre>
<p>!!Please make sure that <em>node2</em> is declared at your <em>/etc/hosts</em> file.</p>
<p>Edit lines you want to effected in /etc/nsswitch.conf, like</p>
<pre>passwd: nis files
shadow: nis files</pre>
<p>if you want make common account database for all.</p>
<p>Also as in server side you need to set variable NISDOMAIN at file /etc/syconfig/network:</p>
<pre>echo "NISDOMAIN=\"my_net\"" &gt;&gt; /etc/syconfig/network</pre>
<p>Now, you are ready to run nis client :</p>
<pre>/etc/init.d/ypbind start</pre>
<p>If its started without errors put it in autoload:</p>
<pre>chkconfig --level 345 ypbind on</pre>
<p>Let&#8217;s check out if everything work fine. Go to the server and create new nis user <strong>nis_test_user</strong>:</p>
<pre>adduser nis_test_user
passwd nis_test_user
cd /var/yp
make</pre>
<p>Back to client box and type:</p>
<pre>ypmatch nis_test_user passwd </pre>
<p>and if its work you will get something like that:</p>
<pre>nis_test_user:$1$qMB3FqLy$XbzjESg3Uuse/.5PTRgPJ1:1000:1000::/home/nis_test_user:/bin/bash</pre>
<p>Also you will be able to login as <em>nis_test_user</em> at your box.</p>
<p>To change password for it use:</p>
<pre>yppasswd user</pre>
<p>!!To use this feature daemon yppasswdd on server side has to be running.</p>
<p>The end.</p>
<p>UPD:<br />
use
<pre>ypwhich -m </pre>
<p> to print all mapping files</p>
<pre>ypcat [mapping file]</pre>
<p> &#8211; to print file</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/07/nis-for-redhat-mini-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
