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,002 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

12 Experts available now in Live!

Get 1:1 Help Now