LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-11-2007, 12:19 PM   #1
extendedping
Member
 
Registered: Feb 2004
Posts: 210

Rep: Reputation: 30
NIS/NFS can't find home directory


Hi, I have 2 centos 5 machines (actually virtual machines running on vmware server on fedora 7 host). for the purposes of learnign linux better I set up an nis domain "domain1" on the first box and made sure to start the appropriate services as per my book. I then make the second box the nis client putting it on the same domain and checkng it on both with the domainname command. I then set up a user on the nis server calling it nisuser1. I shared the home directorys using nfs, here is the output of the exports file


/inst 192.168.1.20(rw,sync) *(rw,sync)
/home 192.168.1.20(rw,sync,nohide)
/etc/exports (END)

I put the stuff in using the graphical manager. the .20 is the second centos that is the nis client.

on the client (centos box 2) I put the following command in the fstab to mount the home directories from box one.

/dev/VolGroup00_main/LogVol00 / ext3 defaults
1 1
LABEL=/boot /boot ext3 defaults
1 2
devpts /dev/pts devpts gid=5,mode=620
0 0
tmpfs /dev/shm tmpfs defaults
0 0
/dev/VolGroup01_home/LogVol00 /home ext3 defaults
1 2
proc /proc proc defaults
0 0
/dev/md0 /raid5 ext3 defaults
1 2
sysfs /sys sysfs defaults
0 0
/dev/VolGroup00_main/LogVol01 swap swap defaults
0 0

centos-5:/home /mnt/home nfs hard,intr 0 0

as you can see the last line is the mount to the home directory on the nis server. the hard,init 0 0 I got from the book, don't really know what it means. but the mount command show this

/dev/mapper/VolGroup00_main-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/mapper/VolGroup01_home-LogVol00 on /home type ext3 (rw)
/dev/md0 on /raid5 type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
centos-5:/home on /mnt/home type nfs (rw,hard,intr,addr=192.168.1.19)
[root@centos-5-net ~]#

so I know the mount worked. also the ypcat passed command shows this...

[root@centos-5-net ~]# ypcat passwd
centos-5-user1:$1$vFqBxV97$4SsEMbcgWO/ksc2Wj9lUc1:500:500:centos-5-user1:/home/centos-5-user1:/bin/bash
centos-5-user2:$1$KjFo1pFF$RI5b3dNeaN3lj4T1fUOE11:501:501::/home/centos-5-user2:/bin/bash
manualuser:$1$kJBT1Feq$8PFvXs7HJi185SVqxsLj40:502:502::/home/manualuser:/bin/bash
nisuser1:$1$CfBnXKiK$TOAvdJNPC1zPkL8.EDW21.:503:503::/home/nisuser1:/bin/bash
[root@centos-5-net ~]#

which indicates to me that the nis client has gotten the right info (/home/nisuser1) from the server. I should mention that I disabled the firewall and selinux on the server as I didn't want to have to deal with that stuff here.

so I expect to be able to log on from the nis host using the name nisuser1 and then see the homedirectory /mnt/home which is where I mounted the remote home directorys to...but I get this message...

su: warning: cannot change directory to /home/nisuser1: No such file or directory
-bash-3.1$

it is the same message I get from the graphical log on screen...so what am I doing wrong here? the output of the ypcat passwd I thought meant that I got the maps correctly from the nis server and this showed the home directory from the /etc/passwd file. hmmm also I updated the /etc/nsswitch to this......

# 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



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

to hopefully make the nis client look for nis stuff after looking in the local files.

any help here would be greatly appreciated...btw dummy down your tech talk as I don't really know that the heck I am doing here
 
Old 07-12-2007, 09:13 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Well ... if the ypasswd file says /mnt/nisuser1 but it's mounted
as /mnt/home/nisuser1 I can't say I'm surprised you get that error
message ... in fact I'd be if you didn't (unless of course you also
manually created a /home/nisuser1 as well) :}



Cheers,
Tink
 
Old 07-13-2007, 12:16 AM   #3
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by extendedping
Hi, I have 2 centos 5 machines (actually virtual machines running on vmware server on fedora 7 host). for the purposes of learnign linux better I set up an nis domain "domain1" on the first box and made sure to start the appropriate services as per my book. I then make the second box the nis client putting it on the same domain and checkng it on both with the domainname command. I then set up a user on the nis server calling it nisuser1. I shared the home directorys using nfs, here is the output of the exports file


/inst 192.168.1.20(rw,sync) *(rw,sync)
/home 192.168.1.20(rw,sync,nohide)
/etc/exports (END)

I put the stuff in using the graphical manager. the .20 is the second centos that is the nis client.

on the client (centos box 2) I put the following command in the fstab to mount the home directories from box one.

/dev/VolGroup00_main/LogVol00 / ext3 defaults
1 1
LABEL=/boot /boot ext3 defaults
1 2
devpts /dev/pts devpts gid=5,mode=620
0 0
tmpfs /dev/shm tmpfs defaults
0 0
/dev/VolGroup01_home/LogVol00 /home ext3 defaults
1 2
proc /proc proc defaults
0 0
/dev/md0 /raid5 ext3 defaults
1 2
sysfs /sys sysfs defaults
0 0
/dev/VolGroup00_main/LogVol01 swap swap defaults
0 0

centos-5:/home /mnt/home nfs hard,intr 0 0

as you can see the last line is the mount to the home directory on the nis server. the hard,init 0 0 I got from the book, don't really know what it means. but the mount command show this

/dev/mapper/VolGroup00_main-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/mapper/VolGroup01_home-LogVol00 on /home type ext3 (rw)
/dev/md0 on /raid5 type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
centos-5:/home on /mnt/home type nfs (rw,hard,intr,addr=192.168.1.19)
[root@centos-5-net ~]#

so I know the mount worked. also the ypcat passed command shows this...

[root@centos-5-net ~]# ypcat passwd
centos-5-user1:$1$vFqBxV97$4SsEMbcgWO/ksc2Wj9lUc1:500:500:centos-5-user1:/home/centos-5-user1:/bin/bash
centos-5-user2:$1$KjFo1pFF$RI5b3dNeaN3lj4T1fUOE11:501:501::/home/centos-5-user2:/bin/bash
manualuser:$1$kJBT1Feq$8PFvXs7HJi185SVqxsLj40:502:502::/home/manualuser:/bin/bash
nisuser1:$1$CfBnXKiK$TOAvdJNPC1zPkL8.EDW21.:503:503::/home/nisuser1:/bin/bash
[root@centos-5-net ~]#

which indicates to me that the nis client has gotten the right info (/home/nisuser1) from the server. I should mention that I disabled the firewall and selinux on the server as I didn't want to have to deal with that stuff here.

so I expect to be able to log on from the nis host using the name nisuser1 and then see the homedirectory /mnt/home which is where I mounted the remote home directorys to...but I get this message...

su: warning: cannot change directory to /home/nisuser1: No such file or directory
-bash-3.1$

it is the same message I get from the graphical log on screen...so what am I doing wrong here? the output of the ypcat passwd I thought meant that I got the maps correctly from the nis server and this showed the home directory from the /etc/passwd file. hmmm also I updated the /etc/nsswitch to this......

# 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



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

to hopefully make the nis client look for nis stuff after looking in the local files.

any help here would be greatly appreciated...btw dummy down your tech talk as I don't really know that the heck I am doing here
Your NIS client machine mounts the home directory of your NIS server (/home) as /mnt/home, so like Tinkster says, it's no surprise that it cannot find /home/nisuser1. Your NIS client machine has /mnt/home/nisuser1, but not /home/nisuser1.

You can get around the problem by creating a symbolic link of /mnt/home/nisuser1 under your local /home as follows:
Code:
# ln -s /mnt/home/nisuser1 /home/nisusers1
That's not a very elegant solution, though. If you want to share your home directory across computers, I would create a separate root directory for all the accounts instead of using "/home". Let's name it "emp," for instance. Then your user account (nisuser1) goes under it like this:

/emp/nisuser1

Export /emp from your NIS server and mount it exactly as /emp on your NIS client.
Code:
centos-5:/emp /emp nfs hard,intr 0 0
This way, your shared home directory will be /emp no matter where you are.
 
Old 07-13-2007, 11:57 AM   #4
extendedping
Member
 
Registered: Feb 2004
Posts: 210

Original Poster
Rep: Reputation: 30
thanks guys...I get it now...whatever is in the nisserver /etc/passwd (home folder) must be the same as what is mounted locally...thanks again mystery solved...
 
Old 08-29-2007, 12:33 PM   #5
Aung Phyo
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by extendedping View Post
thanks guys...I get it now...whatever is in the nisserver /etc/passwd (home folder) must be the same as what is mounted locally...thanks again mystery solved...
Hello dear,
I think I have the same problem with u . I have exported and mounted my home directory successfully. At server side, I exported as shown in below.

Quote:
[root@aung4 ~]# vi /etc/exports
/home/ 82.179.183.107(rw) 82.179.183.106(rw) 82.179.183.105(rw)
/usr/local/ 82.179.183.107(ro) 82.179.183.106(ro) 82.179.183.105(ro)
/share/ 82.179.183.107(rw) 82.179.183.106(rw) 82.179.183.105(rw)

[root@aung4 ~]# exportfs -ra
exportfs: /etc/exports [1]: No 'sync' or 'async' option specified for export "82.179.183.107:/home/".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [1]: No 'sync' or 'async' option specified for export "82.179.183.106:/home".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [1]: No 'sync' or 'async' option specified for export "82.179.183.105:/home".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [3]: No 'sync' or 'async' option specified for export "82.179.183.107:/share/".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [3]: No 'sync' or 'async' option specified for export "82.179.183.106:/share".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [3]: No 'sync' or 'async' option specified for export "82.179.183.105:/share".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
[root@aung4 ~]#
[root@aung4 ~]# /etc/init.d/nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@aung4 ~]#
At client Side, I mounted as shown in Below.

Quote:
[root@aung4 ~]# ssh aung3
Last login: Tue Aug 28 17:02:50 2007
[root@aung3 ~]#
[root@aung3 ~]# vi /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hdc1 swap swap defaults 0 0
aung4.csa.ru:/home /home nfs nouser,rw,suid 0 0
aung4.csa.ru:/usr/local /usr/local nfs nouser,ro,suid 0 0
aung4.csa.ru:/share /share nfs nouser,rw,suid 0 0
/dev/fd0 /media/floppy auto pamconsole,fscontext=system_ubject_r:removable_t,exec,noauto,managed 0 0
[root@aung3 ~]# mount -a
[root@aung3 ~]#/etc/init.d/nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@aung3 ~]#
but when I changed to home directory of slave host. I found the error as shown in below.
Quote:
[root@aung3 ~]# su - aung4
su: warning: cannot change directory to /home/aung4: Permission denied
-bash: /home/aung4/.bash_profile: Permission denied
-bash-3.00$
-bash-3.00$
-bash-3.00$ exit
logout
-bash: /home/aung4/.bash_logout: Permission denied
[root@aung3 ~]#
But when I unmounted those , I can change successfully...
[root@aung3 ~]# umount -a
umount: /var/lib/nfs/rpc_pipefs: device is busy
umount: /: device is busy
[root@aung3 ~]# su - aung4
[aung4@aung3 ~]$


Could you advise me please for that problem ? Expecting to get reply from you...
Good luck to you...
Aung Phyo
 
  


Reply



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
automount home directories with information from Active Directory (or NIS) alex r Linux - Software 5 08-30-2006 10:05 AM
NIS, NFS, autofs and /home folder question ramram29 Linux - Networking 2 08-25-2006 08:26 PM
nis home directory automounting ravi_foru Linux - Networking 2 03-06-2006 09:12 AM
exporting home directory with NFS and NIS cevjr Linux - Networking 2 12-23-2004 10:11 AM
NIS/NFS and sharing home directories grebo Linux - Networking 1 09-21-2001 11:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:23 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration