Setting up NIS

I'm some what new to Unix and I recently have been thrown into a system administration role. I created this thread because I I wish to setup NIS in my lab and I thought this could be benificial to me and many others.

I am followig the Sun System Administation Guide: Naming and Directory Services. I have two freshly installed sun blade 100s with Solaris 9 and the patch cluster on an isolated network. My goal is to make one a master server and the other a client. I will post my progress regularly and also ask questions to the pros that have been doing this for so long.

Thanks,
Steve

ok here we go...

I started by setting the domain name on my server to test.com and creating the /etc/defaultdomain file. Then I created the /etc/nodename file containing the machine name unixnis.

I copied the folling files to a new directory call /nisfiles:
auto_master
auto_home
bootparams (created blank file)
ethers (created blank file)
group
hosts (added ip of client to be)
ipnodes
netgroup
netmask
networks
protocols
rpc
services
user_attr

These are the default file unless otherwise specified.

Next i copied passwd and shadow to /passfiles and then removed the line for root.

I then opened the /var/yp/makefile and changed the DIR value to /nisfiles and the PWDIR value to /passfiles.

I guess it time to attemp to build the nis maps. I run:
/usr/sbin/ypinit -m

  • enter the name of the master
    -say yes to stop on errors

errors coming up in next post

Ok here are the errors i get

Sep 29 12:12:02 unixnis sendmail[4291]: My unqualified host name (unixnis) unknown; sleeping for retry
Sep 29 12:18:02 unixnis sendmail [4291]: unable to qualify my own domain (unixnis) -- using short name
WARNING: local host name (unixnis) is not qualified; fix $j in config file
/var/yp/test.commail.aliases: 13 aliases, longest 16 bytes, 162 bytes total
/usr/lib/netsvc/yp/mkalias /var/yp/'domainname'/netmask.byaddr
updated aliases
make: WARNING: don't knoe how to make target '/nisfiles/publickey'
Current working dircectory /var/yp
Updated netid
/usr/sbin/makedbm /nisfiles/netmask /var/yp/'domainname'/netmask.byaddr
updated netmask
Couldnt find /nisfiles/timezone
Updated auto.master
Updated auto.home
Updated auth_attr
Updated exec_attr
Updated prof_attr
Updated user_attr
Updated audit_user
make: Warning: Target 'all' not remade because of errors
Current working directory /var/yp
*** Error Code 1
make: Fatal Error: comand failed for target 'k'
Error running makefile

Can anybod comment and give me some solutions to fixing these problems?

Thanks

Ok to get this to work I copied over the /etc/publickey file to /nisfiles and created a timezone file and copied to /nisfiles.

Once I did this i ran the ypinit anaing and it worked without a error

I joined the client system using the ypinit -c command. Before doing this i set the domainname to test.com and replaced the /etc/nsswitch.conf with nsswitch.nis.

After rebooting i tried to login and go a message that my home directory was unreachable and to login in fail safe mode.

To fix this i copied auto_home to the /nisfiles and updated the auto.home map.

This allowed me to login but then i got another error about the DT Messenging service could not be started.

To fix this I opened the /etc/dfs/dfstab on the server and added an entry for the /export/home/<username> that i was logging in with on the client.

This seemed to fix it...

Is there easier ways to administer NIS?

To create a user I was using useradd then copying that users line in /etc/passwd to my /passfiles/passwd. I also did this with the shadow. Then I copied the auto_home to /nisfiles. I updated the auto.nome map and the passwd map after that. Then in order for the user to access his home directory I had to open /etc/dfs/dfstab and add an entry for his home directory. This seems exstremely tedious and long just to add a user. Are there easier ways to do this?

As i read all the information you've posted it seems to be looking fine but you have to delete all the users from the passwd and shadow file not just only root.

cp /nsswitch.nis to /nsswitch.conf
Make the following files under /var/yp
bootparms ethers netgroup and so on.
also change the dir in makefile and then ran all the commands....
ypinit -s or -c

I have done all of the things that you suggested already and NIS is functional. My concerns were mainly based around administering the domian.

Like,
The best way to add a user to NIS?
Do you have to add an entry to /etc/dfs/dfstab in order to allow the client to access their home directory on the server? Is there a way to have this automatic after the user has been created?

Thanks,
Steve

Ok for the next step I want to configure NIS for my live environment. This lab is connect to a rather large company network mainly running windows systems.

I have some questions about things I ll need to incorporate into the company network.

I assume that I will need a Static IP for any servers?
Also a subnet for my network?
Should I configure DHCP on the NIS Server?
Should I incorporate DNS forward lookup from the NIS server to the companies central windows DNS server?
Is one Sunblade 100 powerful enough to function as the the NIS master server and central file server for a lab of 25 systems?

Please let me know if there is anything im forgetting or if you can give me some info on these questions.

Thanks