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,084 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

710 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