Link to home
Start Free TrialLog in
Avatar of Mccalma1
Mccalma1

asked on

How do I setup autofs via NIS to mount client's home directory which are located on the server

Hi,

I can get autofs to work on a client Ubuntu computer, but auto.master and auto.local are setup locally oppose to NIS.

My server is running RHEL 6.2 and it's hostname is main. My client is running Ubuntu 12.04.2

I commented out the following in the auto.master file:
/mnt       /etc/auto.local    --timeout=300

And then added the following in the file:
+auto.master

I commented out the following in the auto.local file:
raid        -fstype=nfs,rw,sync,hard,intr                       main:/mnt/raid

And added the following in the file:
+auto.local

Is this the correct way to tell /etc/auto.master and /etc/auto.local to use the NIS database?

I then tried to tell the client to use these files by typing the following:
/usr/lib/yp/ypinit -s main

and received the following in return:
Can't enumerate maps from main. Please check that it is running.

What does that mean? Also, is this the correct way to rebuild the NIS map on the client machine?

Thanks,
Mark
Avatar of Daniel McAllister
Daniel McAllister
Flag of United States of America image

Mark,

At first glance, I think you're over-thinking things.

Once you have an automount working, there should be no need to add NIS (unless you need it for something else).

The mount (auto or otherwise) will already map userIDs, and NFS will prevent root-intrusion (unless you override it). So point your user's home directories (in /etc/passwd) to the location that the automounter is SUPPOSED to put them, and watch the magic happen.

If it turns out you DO need NIS, the error you're reporting is likely that there is no portmapper service running on the NIS server (ypserver). NIS is a portmapped service (as-in, there are no well-known-ports for NIS, they are assigned on the fly by a portmapper routine that can be queried to obtain the current port number). So you seem the "maps from the main" that cannot be mapped are the ports...

I hope this helps.

Dan
IT4SOHO
ASKER CERTIFIED SOLUTION
Avatar of Mccalma1
Mccalma1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mccalma1
Mccalma1

ASKER

We must have posted at the same time.

Anyway, I'm replacing a server at a customer location and they utilize NIS to provide the automount files to the client computers. Currently, I setup a network of computers similar to what is on-site. I have to ship and install mid July.
Sorry, I failed to mention that the nsswitch.conf and ypxfr steps fixed the issue in my initial question. I just have a couple questions:

1. Why did I have to ypxfr the two files manually? Shouldn’t it have automatically done this when I typed the following on the server: "make -C /var/yp"?

2. How are the clients' NIS maps kept up to date normally?

This is my first server setup, so please bare with me.
The nsswitch.conf file didn’t have an automount line in it. I added the following to the file:
“automount   NIS         files”

Also, from the client side, I had to type the following to copy auto.local and auto.master from server to the client:
/usr/lib/yp/ypxfr -f -c -d domainname -h server_hostname auto.master
/usr/lib/yp/ypxfr -f -c -d domainname -h server_hostname auto.local

I had to update the nsswitch.conf and do the ypxfr to get the Ubuntu computer to automount and only the ypxfr command to get a Tru64 Alpha to automount via NIS.