NIS/Autofs Example Setup
Sources:
Damian O'Hara: damian@uklinux.net
Steve Sheriff: fsanta@arrakis.es
Please read the
whole cookbook before you start.
This cookbook
has been developed by an advanced computer engineer and by a novice
Linux user who already had a working Linux-only network, the latter
looking to save time as a system administrator. If you have never
networked computers you will be in for a pleasant surprise as Linux
does most of it for you.
The present
document has to assume however that you already have a correctly
configured network (like clients can see yahoo.com) can undertake to
edit or create (e.g.) /etc /auto.master and know what chkconfig does at
the command line. Indeed, the comand line is where you should be if you
are reading this as you will be running a network and therefore be
resposnible for the work of others. You will not be able to afford
yourself the luxury of a gui as you will be wanting to squeeze every
possible byte of energy from your server to be able to serve your
clients to the maximum. Backup your system and good luck.
SuSE 8.1
NIS/Autofs Setup for new systems running command line only
(recommended)
On the 8.1
installation on the server you will be asked to setup the users you
require. Setup as many as you wish bearing in mind that Yast2 makes this
task easier at setup and after setup. If you plan to add more users
then no problem. On the client do not setup any users other than root.
Yast2 will give you a warning to this effect but ignore it. Do not at
any stage use Yast2 to setup the NIS server.
Please use
<tab> as whitespace.
Here are our
example boxes, both with a minimal install of SuSE 8.1.
Server:
fred.local.com 192.168.1.160
Client:
wilma.local.com 192.168.1.161
NIS domain :
jola
All actions
below are done as "root" user on both boxes.
==============================================
Fred:
Install minimum
system and add ypserv and ypbind (needs CDs 1,2,4).
Create a dummy
user with home directory in /home/USERNAME
Create
/etc/defaultdomain and add the following to it:
jola
Create
/etc/auto.home and populate with:
* 192.168.1.160:/home/&
Put the
following (only) into /etc/auto.master:
/home
auto.home yp rw
Set the
domainname for now:
dommainname jola
Initialise the
ypserver:
/usr/lib/yp/ypinit
-m
after "fred.com"
is displayed press control-d
ignore the
errors beacuse ypserv isn't running yet.
Start ypserv:
chkconfig ypserv
on
rcypserv start
Setup ypbind:
Add the
following to /etc/yp.conf:
ypserver
192.168.1.160
chkconfig ypbind
on
rcypbind start
Export the home
area:
Add the
following to /etc/exports:
/home
192.168.1.160(rw)
(Or use
Yast2>network advanced>nfs
server>192.168.1.160>options>rw)
Start the nfs
server:
chkconfig
nfsserver on
rcnfsserver
start
==============================================
Wilma:
Install minimum
system and add ypbind.
Run "yast nis"
Select "Use NIS"
"Start Automounter"
NIS domain = jola
Address of NIS Server = 192.168.1.160
Create
/etc/auto.home and populate with:
* 192.168.1.160:/home/&
Put the
following (only) into /etc/auto.master:
/home
auto.home yp rw
Restart the
automounter:
rcautofs restart
Do an init 1 and
back up to init 3 or reboot fred
Then the same on
wilma. In that order.
Then to test the
client:
su - USERNAME
and check that
su works and that the home directory mounts OK.
That's it!
Notes: Existing
systems.
You can use the
above method on existing systems but. . .
The automounter
will render useless any existing /home directories on any client that
you have. You may wish to create a directory under e.g.
/usr/local/users and move their home directories there before you start.
Where they eventually end up is a matter for you to decide. If you do
so using Yast2 then remember that you'll have to reenter the user
password again (bug or feature?) What is more important we feel is
that wherever their home directory is, it should be totally
transparent to the user wherever they log in.
Tested with SuSE
8.1:
Server PIV 1.8
256 scsi and PIV 1.8 1024 eide (former faster)
Clients PII 450
Summary: 1. Not
for the faint hearted. 2. Buy more memory. 3. Go with the scsi