Solved

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

Posted on 2013-06-17
5
1,019 Views
Last Modified: 2013-07-06
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
0
Comment
Question by:Mccalma1
  • 4
5 Comments
 
LVL 20

Expert Comment

by:Daniel McAllister
ID: 39256306
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
0
 

Accepted Solution

by:
Mccalma1 earned 0 total points
ID: 39256359
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.

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"?

Also, please correct me if I'm wrong, but I think I figured out the "Can't enumerate maps from main" issue. The "ypinit -s" command is supposed to be ran on a slave server and I tried to run it on an NIS client.

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

Author Comment

by:Mccalma1
ID: 39256371
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.
0
 

Author Comment

by:Mccalma1
ID: 39256384
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.
0
 

Author Closing Comment

by:Mccalma1
ID: 39303707
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.
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Samba is the de-facto standard program (or, more correctly: suite of programs) that UNIX and Linux systems use to share files with Microsoft Windows (and more recently, Mac OS-X) systems. Currently, there are 2 common versions of Samba available,…
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now