So, linux can't automount home directories using autofs and NIS

So, linux can't automount home directories using autofs and NIS

Post by Robert M. Mart » Fri, 20 Nov 1998 04:00:00



        Or so it seems.  I have been trying to get a Red Hat 5.1 machine
to mount user's home directories when they log onto the system using NIS.
The user's can log in, but home directories do not mount.  If I create
a local copy of auto.home the directories mount.  If I try using the NIS map
auto.home nothing happens.  I can ypcat the auto.home file from the NIS server
and, hot damn, it looks EXACTLY like what the linux machine wants a local
auto.home file to look like.  Any attempt to use autofs/NIS is greeted with

login: user
Password: ******
Last login: Tue Nov 17 17:43:25 from meeker
No directory /home/user!
Logging in with home = "/".

        Can Red Hat 5.1 and autofs use an NIS auto.home map?  If so, HOW?
Adding "+auto.home" to an empty /etc/auto.home file doesn't work, nor did any
of the gyrations I tried in /etc/auto.master work - attempts inspired by
Hal Stern's "Managing NFS and NIS."

        Thanks,
        Bob Martel

--
******************************************************************************
 Bob Martel - System Administrator   | I met someone who looks a lot like you
 Levin College of Urban Affairs      | She does the things you do            
 Cleveland State University          | But she is an IBM                      
 (216) 687-2214                      |                                        

******************************************************************************

 
 
 

So, linux can't automount home directories using autofs and NIS

Post by Robert M. Mart » Fri, 20 Nov 1998 04:00:00



:
:       Can Red Hat 5.1 and autofs use an NIS auto.home map?  If so, HOW?

        Never fails, get *really* fustrated, post a question, *then* discover
the answer.

        The /etc/rc.d/init.d/autofs script doesn't seem to like that we do not
have an NIS auto.master, and thus never bothered to create and run an
automount command for the NIS auto.home table - even though I had that
information in the local /etc/auto.master file.

        When I typed the automount command on the command line, things worked
fine.  While I still don't understand why the +auto.home in the local
/etc/auto.home file didn't do the trick I suspect I'll find the reason the
NIS info in the local /etc/auto.master file was not getting used buried
a little deeper in the autofs script.

        -Bob
--
******************************************************************************
 Bob Martel - System Administrator   | I met someone who looks a lot like you
 Levin College of Urban Affairs      | She does the things you do            
 Cleveland State University          | But she is an IBM                      
 (216) 687-2214                      |                                        

******************************************************************************

 
 
 

So, linux can't automount home directories using autofs and NIS

Post by Roger Smit » Wed, 25 Nov 1998 04:00:00



>         Or so it seems.  I have been trying to get a Red Hat 5.1 machine
> to mount user's home directories when they log onto the system using NIS.
> The user's can log in, but home directories do not mount.  If I create
> a local copy of auto.home the directories mount.  If I try using the NIS map
> auto.home nothing happens.  I can ypcat the auto.home file from the NIS server
> and, hot damn, it looks EXACTLY like what the linux machine wants a local
> auto.home file to look like.  Any attempt to use autofs/NIS is greeted with

> login: user
> Password: ******
> Last login: Tue Nov 17 17:43:25 from meeker
> No directory /home/user!
> Logging in with home = "/".

>         Can Red Hat 5.1 and autofs use an NIS auto.home map?  If so, HOW?
> Adding "+auto.home" to an empty /etc/auto.home file doesn't work, nor did any
> of the gyrations I tried in /etc/auto.master work - attempts inspired by
> Hal Stern's "Managing NFS and NIS."

>         Thanks,
>         Bob Martel

> --
> ******************************************************************************
>  Bob Martel - System Administrator   | I met someone who looks a lot like you
>  Levin College of Urban Affairs      | She does the things you do
>  Cleveland State University          | But she is an IBM
>  (216) 687-2214                      |

> ******************************************************************************

Bob,

run a shell ex: get_auto_home

let the shell

exec ypmatch $1 auto_home

Then:

edit /etc/rc.d/init.d/autofs and add...

 ypcat -k auto_master | (
        while read dir map options
        do
            if [ ! -z "$dir" -a ! -z "$map" \
                        -a x`echo "$map" | cut -c1` != 'x-' ]
            then
#               map=`echo "$map" | sed -e 's/^auto_/auto./'`
#               if echo $options | grep -- '-t' >/dev/null 2>&1 ; then
#                   mountoptions="--timeout $(echo $options | \
#                     sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')"
#               fi
#               options=`echo "$options" | sed -e '
#                 s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
#                 s/\(^\|[ \t]\)-/\1/g'`
                MAP=`basename $map`
                echo "/usr/sbin/automount $dir program /usr/admin/get_${MAP}"
            fi
        done
    )
fi

This will do the job!!!

Roger Smith

 
 
 

1. RFH: SunOS NIS users can't "automount" their home directory from NIS+ Server

Thanks to all wjho are taking the time to read this.  The response to
my previous post was outstanding and very successful.

When my users log in to a SunOS box we've got for legacy code
compilation they are able to successfully log in, but they get a "No
Home directory, logging in at /" message.  If I create a directory
called /home/username then they can log in and get sent to that
directory, but its not automounting their directory from the NIS+
server (Running in NIS compatability mode).  The directory that their
user account comes from IS NFS mounted, and they can CD to it, but I
need them to be able to log in  to this direcotry so they can get and
run their .profile file and will know where they are when they start
out.

Can anyone tell me what I need to do to make this work?

Thanks,
Sam Posten

2. A1000 stress tool

3. problem logging in using NIS + automounted home directories.

4. How do I print with my HP inkjet printer?

5. Moving User's Home Directory to a New server using Solstice and Nis+

6. problems w/ masquerading/routing

7. NIS/NFS home directories/Automounting

8. ext3 corruption fix

9. Expanding user's home by automount+NIS

10. /home and automount maps with many home directory servers

11. using autofs and nis with sun nis server

12. automount reading sun's automount file or NIS map

13. Problems loosing home directories when using NIS and amd