LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-12-2011, 07:07 AM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Rep: Reputation: 99
Unhappy AUTOFS not working in NIS


Hi All,

I have all CENTOS 5.5 boxes.

This is my scenario.
Code:
192.168.1.10    box1.test.com    NIS and NFS SERVER
192.168.1.20    box1.test.com    NIS CLIENT / NFS CLIENT (AUTOFS)
These are NFS exports on box1 which I am trying to Automount on box2
Code:
[root@box2 ~]# showmount -e 192.168.1.10
Export list for 192.168.1.10:
/home             *
/nishome/network1 *
I have certain users' home dir. on /home and some users' home dir of network1 in /nishome/network1

Home dirs. under /home are automounting perfectly BUT
home dirs. under /nishome/network1 are not automounting.

Code:
[root@box2 ~]# hostname
box2.example.com

[root@box2 ~]# nisdomainname
ABCD

[root@box2 ~]# getent passwd | tail -4
vicky:$1$132.5HcH$sq6UJxNpFrcUh8l1FAHlV0:502:502::/home/vicky:/bin/bash
vikas:$1$2j6jtgf5$eliQcjFhCbqi.hdZCqaEY/:501:501::/home/vikas:/bin/bash
nisuser1:$1$jejlU3CC$GYEhZl8LHGdAUqn7FXaPu0:800:800::/nishome/network1/nisuser1:/bin/bash
nisuser2:$1$hBQOEA.S$Z3.glka5imAtE6vyJxMBM1:801:801::/nishome/network1/nisuser2:/bin/bash
These are my autofs config files:
Code:
[root@box2 ~]# grep home /etc/auto.master
/home   /etc/auto.home
/nishome /etc/auto.nishome

[root@box2 ~]#  cat /etc/auto.home
*       -fstype=nfs 192.168.1.10:/home/&

[root@box2 ~]#  cat /etc/auto.nishome
*       -fstype=nfs 192.168.1.10:/nishome/network1/&
Now, this is my problem.

Quote:
[root@box2 ~]# su - vikas
[vikas@box2 ~]$ pwd
/home/vikas
[vikas@box2 ~]$ exit
logout
[root@box2 ~]# su - vicky
[vicky@box2 ~]$ exit
logout
[root@box2 ~]# su - nisuser1
su: warning: cannot change directory to /nishome/network1/nisuser1: No such file or directory
-bash-3.2$ exit
logout
[root@box2 ~]# su - nisuser2
su: warning: cannot change directory to /nishome/network1/nisuser2: No such file or directory
-bash-3.2$ exit
logout
Manual mounting goes fine.
Code:
[root@box2 ~]# mount -t nfs 192.168.1.10:/nishome/network1 /nishome

[root@box2 ~]# df -hP /nishome
Filesystem            Size  Used Avail Use% Mounted on
192.168.1.10:/nishome/network1  4.8G  3.7G  857M  82% /nishome

Any help, how to dig it further. I worked fairly on NIS, but never used any other dir. other than /home for automounting.

Apologies, if this post became a little longer. Actually, I have tried to give the maximum information.
 
Old 02-12-2011, 06:20 PM   #2
fortez
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 0
Hi vikas027
assuming oyur nis configuration is correct, can you change passwd entries in box2
Code:
nisuser1:$1$jejlU3CC$GYEhZl8LHGdAUqn7FXaPu0:800:800::/nishome/network1/nisuser1:/bin/bash
nisuser2:$1$hBQOEA.S$Z3.glka5imAtE6vyJxMBM1:801:801::/nishome/network1/nisuser2:/bin/bash
in

Code:
nisuser1:$1$jejlU3CC$GYEhZl8LHGdAUqn7FXaPu0:800:800::/nishome/nisuser1:/bin/bash
nisuser2:$1$hBQOEA.S$Z3.glka5imAtE6vyJxMBM1:801:801::/nishome/nisuser2:/bin/bash
 
Old 02-13-2011, 07:34 AM   #3
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Hi Fortez,

Yes, I can change passwords sitting on NIS cients.

Code:
[root@box2 ~]# su - nisuser1
su: warning: cannot change directory to /nishome/network1/nisuser1: No such file or directory
-bash-3.2$
-bash-3.2$ passwd
Changing password for user nisuser1.
Changing password for nisuser1
(current) UNIX password:
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
-bash-3.2$
 
Old 02-13-2011, 08:31 AM   #4
fortez
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 0
Hi vikas027
in a nis architecture password is changed with yppasswd...
However i mean not to change pasword, but to change home directory from /nishome/network1/nisuser1(2) to /nishome/nisuser1(2)
 
Old 02-13-2011, 08:35 AM   #5
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Unhappy

Quote:
Originally Posted by fortez View Post
Hi vikas027
in a nis architecture password is changed with yppasswd...
However i mean not to change pasword, but to change home directory from /nishome/network1/nisuser1(2) to /nishome/nisuser1(2)
This is what I do not want to do. Actually, in RHCE exam there used to be a question (around 2 years ago) to configure autofs such that /nishome/station1/nisuser1 home directory which is on NIS server gets mounted to local system at /nishome/nisuser1 (not /nishome/station1/nisuser1)

I was able to it there, but could not configure their NIS setup at my place.
 
Old 02-13-2011, 09:19 AM   #6
fortez
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 0
I think you are confusing nis configuration and nfs configuration
I do not understand your RHCE reference, but i think that your nfs configuration is wrong independently from nis use and RHCE exam experience
If you read your nfs maps

Quote:
[root@box2 ~]# grep home /etc/auto.master
/home /etc/auto.home
/nishome /etc/auto.nishome

[root@box2 ~]# cat /etc/auto.home
* -fstype=nfs 192.168.1.10:/home/&

[root@box2 ~]# cat /etc/auto.nishome
* -fstype=nfs 192.168.1.10:/nishome/network1/&
you see that :
- when on client you type cd /home/vikas , you are mounting /home/vikas directoty that is on nfs server
- when on client you type cd /nishome/network1/nisuser1 , you are mounting /nishome/network1/network1/nisuser1 directoty on nfs server; this directory with double network1 do not exist on nfs server
 
Old 02-13-2011, 09:43 AM   #7
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
See I want this, which works well with NFS

Code:
[root@box2 ~]# mount -t nfs 192.168.1.10:/nishome/network1 /nishome

[root@box2 ~]# df -hP /nishome
Filesystem            Size  Used Avail Use% Mounted on
192.168.1.10:/nishome/network1  4.8G  3.7G  857M  82% /nishome
 
Old 02-13-2011, 09:54 AM   #8
fortez
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 0
Afer this manual mount, can you make

Quote:
[root@box2 ~]# su - nisuser1
withou error?
 
Old 02-13-2011, 11:24 AM   #9
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
No.


Code:
[root@box2 ~]# mount -t nfs 192.168.1.10:/nishome/network1 /nishome
[root@box2 ~]# df -HTP
Filesystem    Type     Size   Used  Avail Use% Mounted on
/dev/sda2     ext3     5.1G   3.2G   1.8G  65% /
/dev/sda1     ext3     104M    12M    87M  13% /boot
tmpfs        tmpfs     131M      0   131M   0% /dev/shm
192.168.1.10:/nishome/network1 nfs   5.1G   4.0G   906M  82% /nishome
[root@box2 ~]#
[root@box2 ~]#
[root@box2 ~]# cd /nishome/
[root@box2 nishome]# ls -l
total 8
drwx------ 3 nisuser1 nisuser1 4096 Feb 13 22:52 nisuser1
drwx------ 3 nisuser2 nisuser2 4096 Feb 12 18:01 nisuser2
[root@box2 nishome]#
[root@box2 nishome]# cd
[root@box2 ~]#
[root@box2 ~]# su - nisuser1
su: warning: cannot change directory to /nishome/network1/nisuser1: No such file or directory
-bash-3.2$
 
Old 02-13-2011, 12:37 PM   #10
fortez
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 0
It confirms that you have to change home directory in /etc/passwd file as i have suggested before....

So:
1) if you want that /nishome/nisuser1/ on client matchs /nishome/network1/nisuser1 on nfs server your autofs maps are correct and you have to change your /etc/passwd file in

Quote:
nisuser1:$1$jejlU3CC$GYEhZl8LHGdAUqn7FXaPu0:800:800::/nishome/nisuser1:/bin/bash
nisuser2:$1$hBQOEA.S$Z3.glka5imAtE6vyJxMBM1:801:801::/nishome/nisuser2:/bin/bash
in way that when you type cd /nishome/nisuser1/ on your client, you are using /nishome/network1/nisuser1 on nfs server,

2) if you want that /nishome/network1/nisuser1 on client matchs exactly /nishome/network1/nisuser1 on nfs server your /etc/passwd file is correct but you have to create network1 directory under nishome on client and to change your auto.master map in
Quote:
/home /etc/auto.home
/nishome/network1/ /etc/auto.nishome
Because you have a nis architecure, changes in /etc/passwd or /etc/auto.master have to made on nis server. From these files o nis server then you rebuild corresponding nis maps.

Last edited by fortez; 02-13-2011 at 01:29 PM. Reason: # revision
 
Old 02-14-2011, 02:41 PM   #11
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Hi Fortez,

I do agree about your points, but I am still confused how RHCE server builders did this.
 
Old 02-14-2011, 03:17 PM   #12
fortez
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 0
Assuming you have clear nfs configuration as it was without nis, please can you post:

- nsswitch.conf on nis/nfs client
- auto.master,auto.home,auto.nishome on nis/nfs server
- the output of ls -l /var/yp/your_nis_domain on nis/nfs server
 
Old 09-10-2012, 02:04 PM   #13
tiagofga
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by fortez View Post
Assuming you have clear nfs configuration as it was without nis, please can you post:

- nsswitch.conf on nis/nfs client
- auto.master,auto.home,auto.nishome on nis/nfs server
- the output of ls -l /var/yp/your_nis_domain on nis/nfs server
Hi Fortez,

I has same problem cited above.

My nsswitch.conf is:

Code:
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
#	nisplus			Use NIS+ (NIS version 3)
#	nis			Use NIS (NIS version 2), also called YP
#	dns			Use DNS (Domain Name Service)
#	files			Use the local files
#	db			Use the local database (.db) files
#	compat			Use NIS on compat mode
#	hesiod			Use Hesiod for user lookups
#	[NOTFOUND=return]	Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files nis
shadow:     files nis
group:      files nis
initgroups: files

#hosts:     db files nisplus nis dns
hosts:      files nis dns myhostname

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files     

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus
My auto.home:

Code:
* -fstype=nfs, rw, nolock 10.50.2.154:/export/home/&
My auto.master:

Code:
/home  /etc/auto.home
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NIS and autofs clients not working on Fedora 9 heberrdacruz Linux - Networking 2 11-28-2008 07:13 AM
Fedora 8, NIS, NFS, autofs b1f30 Fedora 1 12-15-2007 03:38 AM
autofs and NIS ljs Linux - Networking 0 10-16-2006 06:07 AM
autofs with NIS lnchrs Linux - Networking 0 03-01-2005 03:36 PM
NIS and autofs with /home Rekna Linux - Networking 1 06-20-2004 11:34 PM


All times are GMT -5. The time now is 03:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration