Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-12-2011, 07:07 AM
|
#1
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Rep: 
|
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.
|
|
|
02-12-2011, 06:20 PM
|
#2
|
Member
Registered: May 2009
Posts: 35
Rep:
|
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
|
|
|
02-13-2011, 07:34 AM
|
#3
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Original Poster
Rep: 
|
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$
|
|
|
02-13-2011, 08:31 AM
|
#4
|
Member
Registered: May 2009
Posts: 35
Rep:
|
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)
|
|
|
02-13-2011, 08:35 AM
|
#5
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Original Poster
Rep: 
|
Quote:
Originally Posted by fortez
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.
|
|
|
02-13-2011, 09:19 AM
|
#6
|
Member
Registered: May 2009
Posts: 35
Rep:
|
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
|
|
|
02-13-2011, 09:43 AM
|
#7
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Original Poster
Rep: 
|
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
|
|
|
02-13-2011, 09:54 AM
|
#8
|
Member
Registered: May 2009
Posts: 35
Rep:
|
Afer this manual mount, can you make
Quote:
[root@box2 ~]# su - nisuser1
|
withou error?
|
|
|
02-13-2011, 11:24 AM
|
#9
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Original Poster
Rep: 
|
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$
|
|
|
02-13-2011, 12:37 PM
|
#10
|
Member
Registered: May 2009
Posts: 35
Rep:
|
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
|
|
|
02-14-2011, 02:41 PM
|
#11
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Original Poster
Rep: 
|
Hi Fortez,
I do agree about your points, but I am still confused how RHCE server builders did this.
|
|
|
02-14-2011, 03:17 PM
|
#12
|
Member
Registered: May 2009
Posts: 35
Rep:
|
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
|
|
|
09-10-2012, 02:04 PM
|
#13
|
LQ Newbie
Registered: Sep 2012
Posts: 1
Rep: 
|
Quote:
Originally Posted by fortez
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
|
|
|
All times are GMT -5. The time now is 11:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|