autofs nfs mounting home directories question
ok this is on centos 5.1...what I am trying to do...I have 2 computers both running centos 5.1. 192.168.1.13 is the "server" and I have shared the home directory in the /etc/exports file with permission for everyone. 192.168.1.110 is the "client" and on this machine I have started autofs/nfs and put the following line in the /etc/auto.master
and the following line in /etc/auto.home
" -rw,intr,soft 192.168.1.13:/home/&
ok so far...I created a user nfs user on the server (.13) and then from the client I su - nfsuser. I then do a df -hP and do see the nfs mount and can cd to the /home/nfsuser directory with no problem. so to that point I am ok.
but now I can't have local users (will not let me create a home directory for that user under /home EVEN WHEN THE AUTOMOUNT IS NOT IN USE AND TIMED OUT. so I say...how can I use autofs/nfs to mount the remote home directories from .13 to .110 but have them mount in a different spot...well I then created a /mnt/home directory on the client and changed both the /etc/auto.master file line to read
the auto.home still reads * -rw,intr,soft 192.168.1.13:/home/&.
by my (obviously flawed) logic I should now (after restarting nfs and autofs) be able so su - nfsuser...and see that remote directory mounted on /mnt/home. but the su - nfsuser fails and simply says "su cannot change to /home/nfsuser no such file or directory.
well first off why are home directories from the server not mounting on /mnt/home on the client? I kind of understand that su is expecting to see the dir on home...but I can't understand why the automounter is not mounting to /mnt/home.
anyway to make an already long story longer...I am studying for a linux test and suspect they will have automounter stuff on it for using it to mount remote dirs...I also suspect they will have you set up local users for other tasks such as sgid collaborative groups, etc...so I really would like to know how to mount remote directories and either be able to specify an alternate location for them so home can still be used for local user ... or at least I would like to know why I cannot create a local user with a home directory (I can create the user with useradd but it will not create a home directory) when there is no remote user home directory mounted on the local home directory of the client...thanks much in advance as I am sure I am probably missing an essential concept here...
btw let me change that I bit...I CAN in fact create users in the local home directory...but I swear I could not before making this post...so the question then is how to mount directories in an alternate location...
ok scrap that...I went back again and tried to su again to a local user and it would not work...it su - to them but not to the /home directory only to /. i checked that the remote home was not mounted and even turned off the automounter. strange. now the only way I can see the local home dir users or so to one of them is to turn off the automounter and reboot...so this is strange me thinks...help....
Try reading this http://www.linuxquestions.org/questi...etwork-607346/
Pay attention to what happens when local users logon vs nis user logon.
"sharing home directory
Perhaps pointing out the obvious but you will have five users doing nothing if your NIS server goes down.
Consider having the /home directory for each user on his own machine. Joe's box would have a /etc/passwd[shadow] entry setting his home directory to /home/Joe. On your NIS server create users (same uid as you say you are doing) and assign their home under /home/users/ . Thus Joe on the NIS server would be /home/users/Joe with same info in the NIS server passwd file.
Now when Joe sits at his box: He logs in and passwd sets his home to /home/Joe.
when Joe sits at any other box: He logs in (thru the NIS server) and his home is set to /home/users/Joe
Last step is to use rsync to keep home directories on NIS server in sync with "sits at" boxes.
Just a concept you might want to explore
ok I get that (I think) but here is what I do not understand. again I have set up the auto.master to reference the auto.home. the auto.home reads * 192.168.1.13:/home/&
I also reduced the timeout value to 30 seconds. Ok so...now when automounter is not on I can see the local users when I cd into /home. that makes sense. then with automounter on I su - nfsuser. this user is on the nis server at 192.168.1.13. works great and mounts to the local /home dir. so far so good. but I then exit out of that user and wait for the timeout...I do a df -hP to see that the nfs mount is gone....I then ls /home and there is nothing..no local user and no nis/nfs user (the before mentioned "nfsuser". so the fact that a cd or an ls into the /home dir does not show the local users tell me that something is still mounted on the /home directory...right? so I cd' into the /home and then I open another terminal and do a df -hP. well the 192.168.1.13 IS NOT shown...so that tells me nothing is mounted on /home. but I can't see the local users so something must be mounted on /home right? well I then turn off the automounter "service autofs stop". then I cd out of the /home and back into the /home directory...and you know what I see? I see the home directory of 1 of the 10 local users I have set up...that is bizzare...so I make sure that user is not logged on and they are not...what the heck...so I less the /etc/passwd just to make sure I am not crazy...and there are my other local users all with /home specified in the file. yet only one of them now show having a home directory. I then reboot (making sure to chkconfig autofs off and upon reboot my local users are there....... to this just makes no sense to me at all...
|All times are GMT -5. The time now is 06:55 AM.|