|
发表于 2005-11-1 23:24:22
|
显示全部楼层
I read all the postings about nis+autofs and did thousands tests. Here is the conclusion:
Case 1: client side /home is not a partition, but just a local file system under /.
In this case, you can autofs mount client's /home directly on server's /home, BUT
这样你那些在客户机没有登陆NIS域前的就有的本地用户can't find their their home directory, since client's /home is mounted on server's /home.
Case 2; client side /home is a partition, no access to modify server side to change user's home directory
In this case, I tried several workarounds, but none of them work fine.
a. Create a soft link on CLIENT side called /rhome --> /home, auto.master use /rhome as mount point, then the client's /home will be using the link /rhome to mount to server's /home, but all my client local users' home directory is lost, since the autofs mount just take over the original mount.
b. Create a sub dir on CLIENT side under /home, for example, /home/nis, auto.master use /home/nis as mount point, but then user log in will complain "can't find /home/user1", because autofs mounted to /home/nis/user1, not /home/user1
To conclude, in both cases, if you don't want to mess up your client's local users /home directory and at the same time want to mount correctly to NIS server's /home directory, you have to have access to SERVER side:
1. On SERVER side,
---Create a soft link /rhome to /home, and edit the /etc/passwd file, change user's /home to /rhome, export /home as nfs file system.
---Or simpler, don't create any link. Just place all nis users under /rhome (useradd -d /rhome/user1 user1), and export /rhome as nfs filesystem.
2. On CLIENT side, no matter /home is a local file system or partition, don't use /home as mount point. mkdir /rhome and autofs use /rhome
Please correct me if I am wrong |
|