The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 FreeBSD NIS client setup
Author: Ross Dickey 
Date:   16-04-08 21:38

I found this article on setting up NIS on FreeBSD:
http://www.freebsddiary.org/nis-client.php

It's a bit outdated and doesn't work anymore. So I updated it, but I don't know where/how to submit it, or how to make the cool formatting. Here's the text for now in case someone needs it. Worksforme on 7.0-release. Not sure about forward/backward compatability:



Setting up the client
We are going to assume a few things about your setup. Your NIS domain is domain.com, and your NIS servers are nisserver1 (master) and nisserver2 (slave). Edit your /etc/rc.conf and add the following lines:

nis_client_enable="YES"
nisdomainname="domain.com"
nis_client_flags="-s -S domain.com,nisserver1,nisserver2"

The spacing is important on some versions of FreeBSD, so be careful to keep the spacing correct.

Now, edit your /etc/group file, and add a + to the end (last line). It should look something like:

dialer:*:68:
network:*:69:
nogroup:*:65533:
nobody:*:65534:
+:::

Editing the hosts file
Edit your /etc/hosts file and make sure you have the local machine, and both NIS servers in the list. Add a +:: to the end (last line). It should look something like this (you may not have to do this if you are a name server):

127.0.0.1 localhost.yourdomain.com localhost
10.1.1.222 fridge.yourdomain.com fridge
10.1.1.76 nisserver1.yourdomain.com nisserver1
10.1.1.31 nisserver2.yourdomain.com nisserver2
+::


Editing the nsswitch.conf file
Edit your /etc/nsswitch.conf file, and change these lines:
group: compat
passwd: compat
hosts: files dns

To this:
group: files nis
passwd: files nis
hosts: files dns nis


Editing the master.passwd file
Now do a vipw master.passwd, and add a +::::::::: to the end (last line) of the file. It should look something like this:

uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin
+:::::::::

Do NOT edit the passwd file, and make sure you have the right number of :'s. Also, make sure you have the correct DNS settings in your /etc/resolv.conf file.

The easiest thing to do at this point is to reboot.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 FreeBSD NIS client setup   new
Ross Dickey 16-04-08 21:38 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org