Operating System - HP-UX
1827059 Members
4164 Online
109713 Solutions
New Discussion

Re: NIS & User Home Directory on a different Server.

 
SOLVED
Go to solution
Lenin Antao
New Member

NIS & User Home Directory on a different Server.

I have an NIS environment. I am trying to add users, the home directory for these users is not local i.e the home dirs are on remote servers.Appreciate input from folks who have implemented this setup as to how this can be done and details for the same.

Note : Logging into each server and manually creating the home directory is not an option for me.

Thanks

Lenin.
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: NIS & User Home Directory on a different Server.

I assume that you are using automounted /home directories with NIS managing the automount maps as well as the passwd/group files.

It's really not very complicated.
1) On each target host, create a skeleton directory structure to hold prototypes for .profile, .dtprofile, etc. for each user.
Let's call it /root/skel/User1


Now for each new user after adding to passwd/group:

remsh ${REMHOST} "mkdir /home/${NEWUSER}"
remsh ${REMHOST} "find /root/skel/User1 -print | cpio -pudvm /home/${NEWUSER}/"
remsh ${REMHOST} chown -R ${NEWUSER}:${NEWGROUP} /home/${NEWUSER}


If it ain't broke, I can fix that.
Lenin Antao
New Member

Re: NIS & User Home Directory on a different Server.

Clay :

Thanks for the quick response. However as I am green in the NIS admin part I would like some details on what you meant by "having automounted /home directories with NIS managing the automount maps."
and how can I implement it.



Brian Vance
Advisor

Re: NIS & User Home Directory on a different Server.

Check the /etc/nsswitch.conf file on the clients. If you have nis on the automount line, then the clients are using NIS maps for automount. You would then need to edit the auto_master (and any files it references) to automount the home directories from the NFS home directory servers. You then need to remake the NIS maps.
The Real MD
Valued Contributor

Re: NIS & User Home Directory on a different Server.

I assume you have setup the NFS mount directories. If not you need to do this first export the local home dirs on SERVER A

vi /etc/exports file and enter some file system to be exported /home

then type in exportsfs -a

have a look here for more info

http://www.docs.hp.com/hpux/pdf/B1031-90043.pdf

on your remote machine SERVER B in the root dir create a directory called allhomes

vi the /etc/fstab on the last line
add something like

SERVER A:/home /allhomes nfs rw,suid 0 0

and type mount -a

this will get you going, have a read of the docs.

Hope this helps

Martin.
A. Clay Stephenson
Acclaimed Contributor

Re: NIS & User Home Directory on a different Server.

This document will get you started:
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B1031-90048/B1031-90048_top.html&con=/hpux/onlinedocs/B1031-90048/00/00/3-con.html&toc=/hpux/onlinedocs/B1031-90048/00/00/3-toc.html&searchterms=NIS%7cManaging&queryid=20040317-091312

but I really suggest that you get a copy of the O'reilly book "Managing NFS and NIS". It will tell you everything you need to know.

Finally, unless you have some compelling reason to learn NIS, you would be better served to learn LDAP. NIS (or NIS+) is not a long-term solution.
If it ain't broke, I can fix that.
Lenin Antao
New Member

Re: NIS & User Home Directory on a different Server.

Guys :

Thanks for you answers.

Lenin