<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="home" title="HomePage" href="HomePage.html" />
<link rel="help" title="HowToUseWiki" href="HowToUseWiki.html" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.org/ThePhpWikiProgrammingTeam" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="noindex,nofollow" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="generator" content="PhpWiki" />
<meta name="PHPWIKI_VERSION" content="1.3.14" />

<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="phpwiki-printer.css" />
<title>PhpWiki - NIS Authenticated Linux workstation on an e-smith server</title>
</head>
<body>

<div id="header">
  
<!-- Page title -->
<h1>NIS Authenticated Linux workstation on an e-smith server</h1>
</div>
<div id="content">



<div class="wikitext"><h2>How- To Linux workstation with SME server</h2>
<p class="tightenable">ver 0.8</p>
<p class="tightenable">Adam Landow</p>
<p class="tightenable">Lecturing Support Officer,</p>
<p class="tightenable">Alice Springs Correctional Centre</p>
<p class="tightenable">Alice Springs N.T 0870</p>
<p class="tightenable">email: adamlandow at bonbon.net</p>
<h3>Scope:</h3>
<p class="tightenable">This how-to illustrates a scenario where Linux workstations and an e-smith SME server can entirely replace a Windows network with domain logons replaced with native NIS authentication, and roaming profiles replaced with shared home directories on the e-smith box.</p>
<p class="tightenable">The motivation for this is a) to prove that in many cases, Windows is NOT necessary at all, b) to provide a more stable computing environment in a SME environment, and c) save stacks of cash.</p>
<p class="tightenable">Example: a community organization (community corrections in my case) is donated a number of ex-military PC’s with completely blank hard drives. Funding is minimal, and accountability is high, so using a ‘wink wink’ copy of Windows is not an option if you want to stay on this side of the wire.</p>
<p class="tightenable">However, a Windows-like environment is necessary to minimise training requirements.</p>
<h4>Software Version information:</h4>
<p class="tightenable">The SME version used in this how-to is 6.0.1-01</p>
<p class="tightenable">The workstation used in this how-to is Xandros Desktop version 3, OC Edition. This was chosen due to it’s accurate emulation of Windows environment and it’s ability to be upgraded to run Windows binaries if necessary using CrossOver Office for a modest fee. Other workstation distributions could conceivably be substituted here.</p>
<p class="tightenable">For reference, Xandros 3 OC is a variant on the Debian Sarge distribution.</p>
<h4>Assumed knowledge:</h4>
<p class="tightenable">Acquisition and installation of rpm packages on an e-smith SME server. I usually download them from a workstation, dump them into an I-bay and use Midnight Commander to navigate around from within an SSH shell before running the rpm –Uvh insertpackagehere.rpm. For shell access I use PuTTY.</p>
<p class="tightenable">Editing of configuration files using your favourite editor: again, Midnight Commander is my favourite, but the ‘old-skool’ diehards will probably want to use Vi or some other obscure thing.</p>
<p class="tightenable">Using Debian’s apt-get utility to install the necessary modules on the workstation.</p>
<h4>Files required for server:</h4>
<p class="tightenable">from <a href="http://www.dungog.net/sme/files/nis-nfs/" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://www.dungog.net/sme/files/nis-nfs/</span></a></p>
<p class="tightenable">dungog-nis-0.1-1.noarch.rpm
e-smith-nfs-1.2.1-04sjn01.noarch.rpm
nfs-utils-0.3.3-5.i386.rpm
portmap-4.0-41.i386.rpm
ypserv-2.2-9.i386.rpm
yp-tools-2.6-4.i386.rpm
ypbind-1.10-7.i386.rpm</p>
<h4>References:</h4>
<p class="tightenable">Swerts-Knudsen.dk website, page</p>
<p class="tightenable"><a href="http://sme.swerts-knudsen.dk/howtos/howto_31.htm" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://sme.swerts-knudsen.dk/howtos/howto_31.htm</span></a></p>
<p class="tightenable">Stephen Noble's how-to (essentially this one)</p>
<p class="tightenable"><a href="http://www.dungog.net/sme/files/nis-nfs/README.txt" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://www.dungog.net/sme/files/nis-nfs/README.txt</span></a></p>
<p class="tightenable">NIS generic how-to</p>
<p class="tightenable"><a href="http://www.opennet.ru/docs/HOWTO/NIS-HOWTO/" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://www.opennet.ru/docs/HOWTO/NIS-HOWTO/</span></a></p>
<h3>1) Server setup.</h3>
<h4>NIS</h4>
<p class="tightenable">From a fresh install of SME;</p>
<p class="tightenable">NIS or Network Information Service, is a service that provides information, that has to be known throughout the network, to all machines on the network. NIS is a system that becomes very useful when you have more than one SME server in your network and you want to be able to log into all with the same username.</p>
<p class="tightenable">Install the rpm`s from the nis-nfs directory.</p>
<blockquote class="tightenable"><p class="tightenable top bottom">[root@sme ]# rpm -Uvh ypserv-* portmap-* dungog-nis-*</p>
</blockquote>
<p class="tightenable">Start the portmap and ypserv services</p>
<blockquote class="tightenable"><p class="tightenable top bottom">[root@sme ]# service portmap start
[root@sme ]# service ypserv start</p>
</blockquote>
<p class="tightenable">Now we have to make sure the NIS Server is running. The following command should return this output.</p>
<blockquote class="tightenable"><p class="tightenable top bottom">[root@sme ]# rpcinfo -u localhost ypserv</p>
</blockquote>
<p class="tightenable">program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting</p>
<dl><dt class="tightenable">Now on the NIS Master run</dt>
<dd class="tightenable">[root@sme ]# /usr/lib/yp/ypinit -m</dd>
</dl>
<p class="tightenable"><u title="Empty link to: adam- nicked from Damian" onmouseover="window.status=&quot;Empty link to: adam- nicked from Damian&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">adam- nicked from Damian</u></p>
<p class="tightenable">create /var/yp/push and fill with:</p>
<p class="tightenable">grep &quot;/home/e-smith/files/users&quot; /etc/passwd | awk -F: ' {print $1&quot;:&quot;$2&quot;:&quot;$3&quot;:&quot;$4&quot;:&quot;$5&quot;:\/home\/&quot;$1&quot;:\/bin\/bash&quot;}' &gt; /etc/passwd.dist
make</p>
<blockquote class="tightenable"><p class="tightenable top bottom">[root@sme ]# chmod 755 /var/yp/push</p>
</blockquote>
<p class="tightenable">Edit /var/yp/Makefile and change the line which says:</p>
<p class="tightenable">PASSWD = $(YPPWDDIR)/passwd</p>
<p class="tightenable">to</p>
<p class="tightenable">PASSWD = $(YPPWDDIR)/passwd.dist</p>
<p class="tightenable">also add to makefile where it says</p>
<p class="tightenable">all: passwd group shadow \ (about line 103)</p>
<p class="tightenable">so it says</p>
<p class="tightenable">all: passwd group shadow auto.master auto.home</p>
<p class="tightenable">(When you run /var/yp/push only the user entries from /etc/passwd are crunched into an alternative passwd file with corrected homedir paths for the client automounters to use. Also we don't want to distribute SME's root password to everyone do we ?)</p>
<p class="tightenable">Make the following the only entries in /etc/auto.master</p>
<p class="tightenable">/home auto.home</p>
<p class="tightenable">Create /etc/auto.home and add the following</p>
<p class="tightenable">* -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid 192.168.100.40:/home/e-smith/files/users/&amp;/home</p>
<p class="tightenable">where 192.168.100.40 is, of course, the IP of your server</p>
<p class="tightenable">Run /var/yp/push by typing, while in the /var/yp directory</p>
<blockquote class="tightenable"><p class="tightenable top bottom">[root@sme ]# ./push</p>
</blockquote>
<p class="tightenable">[adam- also may need to run nfslock on server and client]</p>
<p class="tightenable">[you may need ypbind and yp-tools to test your sme nis if you have problems sn]</p>
<h4>-----------------   NFS setup  ----------------------------</h4>
<p class="tightenable">1) rpm -Uvh e-smith-nfs-1.21-04sjn01.noarch.rpm nfs-utils-0.3.3-5.i386.rpm</p>
<p class="tightenable">2) populate /etc/exports and start NFS</p>
<p class="tightenable">[root@sme]# /sbin/e-smith/signal-event nfs-update</p>
<p class="tightenable">3) Make it run on bootup</p>
<p class="tightenable">[adam- perhaps better to use ln -s /etc/rc.d/init.d/nfs /etc/rc7.d/S99nfs?]</p>
<p class="tightenable">[root@sme]# /sbin/e-smith/db configuration set nfs service</p>
<p class="tightenable">[root@sme]# /sbin/e-smith/db configuration setprop nfs status enabled</p>
<h4>===============  1) Client setup   =================================</h4>
<blockquote class="tightenable"><p class="tightenable top bottom">---------------  NIS Setup ---------------------</p>
</blockquote>
<p class="tightenable">1) Download Xandros 3.01 OC Edition, either using <u title="Empty link to: BitTorrent" onmouseover="window.status=&quot;Empty link to: BitTorrent&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">BitTorrent</u> (faster and free) or pay the $10 US to grab it from their server.</p>
<p class="tightenable">2) Install on the client machine with standard install options.</p>
<p class="tightenable">3) Set up the NIS client:</p>
<p class="tightenable">a) open Xandros Networks application and click on the Debian unsupported site option found under edit -&gt; Set Application Sources.</p>
<p class="tightenable">c) open terminal, logon as superuser, or su</p>
<blockquote class="tightenable"><p class="tightenable top bottom">apt-get install nis</p>
</blockquote>
<p class="tightenable">d) edit /etc/yp.conf to contain the line</p>
<p class="tightenable">ypserver yourservername.yourdomain.com broadcast
<u title="Empty link to: added broadcast sn" onmouseover="window.status=&quot;Empty link to: added broadcast sn&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">added broadcast sn</u></p>
<p class="tightenable">e) edit /etc/hosts to contain the line edited to suit</p>
<p class="tightenable">192.168.1.1 yourservername.yourdomain.com yourservername</p>
<p class="tightenable">where IP address is that of your server</p>
<p class="tightenable"><u title="Empty link to: only needed if ping servername doesn't work, it should sn" onmouseover="window.status=&quot;Empty link to: only needed if ping servername doesn\'t work, it should sn&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">only needed if ping servername doesn't work, it should sn</u></p>
<p class="tightenable">f) restart NIS</p>
<blockquote class="tightenable"><p class="tightenable top bottom">/etc/init.d/nis restart</p>
</blockquote>
<p class="tightenable">Check to see if NIS is working by entering into a terminal</p>
<blockquote class="tightenable"><p class="tightenable top bottom">ypcat passwd</p>
</blockquote>
<p class="tightenable">also check to see that auto.master and .home are being exported</p>
<p class="tightenable">ypcat auto.home
ypcat auto.master</p>
<p class="tightenable">and if all's good you'll get the password hashes of all the users on your e-smith box! and other handy info!</p>
<blockquote class="tightenable"><p class="tightenable top bottom">-----------------   NFS setup  ----------------------------</p>
</blockquote>
<p class="tightenable">automount- should work.</p>
<p class="tightenable">On RH8 the automounter should be working once installed. The auto home dir thingie is exported from the server so there should be very little intervention needed on the part of the client.</p>
<p class="tightenable">Xandros has one, but it's not clear at the moment how to get it happening.</p>
<p class="tightenable">I saw something somewhere about 99% of problems with automount being due to a non-empty /home dir. Is this true? It would explain my success with a fresh RH8 install
but not a Xandros install on a machine I'm using all the time with local accounts...</p>
<p class="tightenable">reboot the workstation and try logging on as one of the users in the e-smith box!</p>
<dl><dt class="tightenable">Current issues/requests</dt>
<dd class="tightenable bottom"><ul><li class="tightenable top bottom">some devices dependent on group membership of the local machine (audio being a major case in point) won't work.</li>
<li class="tightenable top bottom">NFS won't start at bootup on the server; chkconfig doesn't seem to do it properly</li>
<li class="tightenable top bottom">There is probably a whole bunch of security holes here, not least of which is the ability to grab password hashes. l0pht crack, anyone?</li>
</ul>
</dd>
</dl>
</div>

<div id="footer">  <hr class="printer" noshade="noshade" />
<p class="editdate">Owner: &quot;Wilheim&quot;  Last edited on June 30, 2005  3:12 am by &quot;Wilheim&quot;</p>
</div>

</div>
<!-- Add your Disclaimer here -->
</body>
</html>
