Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2004 12:23:25 -0800 (PST)
From:      Jamel Brown <viril29@yahoo.com>
To:        freebsd-config@freebsd.org
Subject:   Setting up NIS
Message-ID:  <20040324202325.95791.qmail@web60510.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
freebsd1.compulinux.org 4.9-RELEASE FreeBSD
4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003    
root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC
 i386

freebsd2.compulinux.org 4.9-RELEASE FreeBSD
4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003    
root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC
 i386

freebsd3.compulinux.org 4.9-RELEASE FreeBSD
4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003    
root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC
 i386

FreeBSD freebsd4.compulinux.org 4.9-RELEASE FreeBSD
4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003    
root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC
 i386     

I'm having several problems setting up nis on my
system I have 4 computers that I am trying to setup
nis on. The roles I would like my computers to play
are as follows Freebsd1 Server, Freebsd2 Slave,
Freebsd3 Client, and Freebsd4 Client. I have been
trying to set up NIS according to what the FreeBSD
hand book says several times but all with no luck. Ok
here's is another thing I’m new to FreeBSD so I don’t
know how to use vi and vipw very well so I always use
Pico or edit instead please let me know if I am
causing the problem by not using these programs. Also
if you notice I have missed anything please let me
know. I am not going to explain freebsd4 because
freebsd3 is the same as it. Everything I typed in is
after a fresh install of FreeBSD this is no other
programs running except what is listed in /etc/rc.conf
Also Please Type in the exact command needed to fix my
problem if at all possible as I have stated before I
am new to FreeBSD so please assume I don’t know.

This is my output of /etc/rc.conf on Freebsd1
freebsd1# cat /etc/rc.conf
kern_securelevel_enable="NO"
nfs_reserved_port_only="YES"
sendmail_enable="YES"
sshd_enable="YES"
usbd_enable="YES"
moused_port="/dev/psm0"
moused_type="auto"
moused_enable="YES"
named_enable="YES"
ifconfig_rl0="inet 192.168.123.1  netmask
255.255.255.0"
ipv6_enable="YES"
defaultrouter="192.168.123.254"
hostname="freebsd1.compulinux.org"
nisdomainname="compulinux.org"
nis_server_enable="YES"
nis_yppasswdd_enable="YES"

This is /etc/rc.conf on freebsd2
freebsd2# cat /etc/rc.conf
kern_securelevel_enable="NO"
nfs_client_enable="YES"
nfs_reserved_port_only="YES"
sendmail_enable="YES"
sshd_enable="YES"
usbd_enable="YES"
ifconfig_rl0="inet 192.168.123.2  netmask
255.255.255.0"
moused_port="/dev/psm0"
moused_type="auto"
moused_enable="YES"
ipv6_enable="YES"
defaultrouter="192.168.123.254"
hostname="freebsd2.compulinux.org"
named_enable="YES"
nisdomainname="compulinux.org"
nis_yppasswdd_enable="YES"
nis_server_enable="YES"

This is /etc/rc.conf on Freebsd3
freebsd3# cat /etc/rc.conf
kern_securelevel_enable="NO"
moused_enable="YES"
moused_port="/dev/psm0"
moused_type="auto"
nfs_reserved_port_only="YES"
nfs_server_enable="YES"
mountd_flags="-r"
sendmail_enable="YES"
sshd_enable="YES"
usbd_enable="YES"
ifconfig_rl0="inet 192.168.123.3  netmask
255.255.255.0"
ipv6_enable="YES"
defaultrouter="192.168.123.254"
hostname="freebsd3.compulinux.org"
nis_client_enable="YES"
nisdomainname="compulinux.org"

This is my /etc/master.passwd on freebsd3
freebsd3# cat /etc/master.passwd
# $FreeBSD: src/etc/master.passwd,v 1.25.2.6
2002/06/30 17:57:17 des Exp $
#
root:$1$9S9qmgEH$RNedtYvD6KwWd.R09ku2.0:0:0::0:0:Charlie
&:/root:/bin/csh
toor:*:0:0::0:0:Bourne-again Superuser:/root:
daemon:*:1:1::0:0:Owner of many system
processes:/root:/sbin/nologin
operator:*:2:5::0:0:System &:/:/sbin/nologin
bin:*:3:7::0:0:Binaries Commands and
Source:/:/sbin/nologin
tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin
kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin
games:*:7:13::0:0:Games
pseudo-user:/usr/games:/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/sbin/nologin
man:*:9:9::0:0:Mister Man
Pages:/usr/share/man:/sbin/nologin
sshd:*:22:22::0:0:Secure Shell
Daemon:/var/empty:/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission
User:/var/spool/clientmqueue:/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default
User:/var/spool/mqueue:/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin
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
www:*:80:80::0:0:World Wide Web
Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged
user:/nonexistent:/sbin/nologin

+:::::::::

This is /etc/group on Freebsd3

freebsd3# cat /etc/group
# $FreeBSD: src/etc/group,v 1.19.2.3 2002/06/30
17:57:17 des Exp $
#
wheel:*:0:root
daemon:*:1:daemon
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:root
mail:*:6:
bin:*:7:
news:*:8:
man:*:9:
games:*:13:
staff:*:20:root
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
guest:*:31:root
bind:*:53:
uucp:*:66:
xten:*:67:xten
dialer:*:68:
network:*:69:
www:*:80:
nogroup:*:65533:
nobody:*:65534:

+:*::

The handbook then tells you to type a couple simple
things into the server
1. nisdomainname="compulinux.org"
2. nis_server_enable="YES"
3. nis_yppasswdd_enable="YES"
after doing that Instead of running /etc/netstart I
just reboot
then run the following commands
# cp /etc/master.passwd /var/yp/master.passwd
# cd /var/yp
# edit master.passwd
Removing all sytem account 
# chmod 600 master.passwd
freebsd1# ypinit -m compulinux.org
Server Type: MASTER Domain: compulinux.org

Creating an YP server will require that you answer a
few questions.
Questions will all be asked at the beginning of the
procedure.

Do you want this procedure to quit on non-fatal
errors? [y/n: n]  

Ok, please remember to go back and redo manually
whatever fails.
If you don't, something might not work. 

At this point, we have to construct a list of this
domains YP servers.
freebsd1.compulinux.org is already known as master
server.
Please continue to add any slave servers, one per
line. When you are
done with the list, type a <control D>.
        master server   :  freebsd1.compulinux.org
        next host to add:  freebsd2.compulinux.org
        next host to add:  ^D
The current list of NIS servers looks like this:

freebsd1.compulinux.org
freebsd2.compulinux.org

Is this correct?  [y/n: y]  y
Building /var/yp/compulinux.org/ypservers...
Running /var/yp/Makefile...
NIS Map update started on Sun Mar 21 06:04:03 CST 2004
for domain compulinux.org
Updating hosts.byname...
Creating new /var/yp/passwd file from
/var/yp/master.passwd...
Updating netid.byname...
Updating hosts.byaddr...
yp_mkdb: no key -- check source file for blank lines
Updating networks.byaddr...
yp_mkdb: no key -- check source file for blank lines
yp_mkdb: no key -- check source file for blank lines
Updating networks.byname...
yp_mkdb: no key -- check source file for blank lines
yp_mkdb: no key -- check source file for blank lines
Updating protocols.bynumber...
Updating protocols.byname...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
yp_mkdb: duplicate key 'compressnet/tcp' - skipping
yp_mkdb: duplicate key 'compressnet/udp' - skipping
yp_mkdb: duplicate key 'mit-ml-dev/tcp' - skipping
yp_mkdb: duplicate key 'mit-ml-dev/udp' - skipping
yp_mkdb: duplicate key 'rap/tcp' - skipping
yp_mkdb: duplicate key 'rap/udp' - skipping
yp_mkdb: duplicate key '351/tcp' - skipping
yp_mkdb: duplicate key '351/udp' - skipping
yp_mkdb: duplicate key '352/tcp' - skipping
yp_mkdb: duplicate key '352/udp' - skipping
yp_mkdb: duplicate key '666/tcp' - skipping
yp_mkdb: duplicate key '666/udp' - skipping
yp_mkdb: duplicate key '751/tcp' - skipping
yp_mkdb: duplicate key '751/udp' - skipping
yp_mkdb: duplicate key '754/tcp' - skipping
yp_mkdb: duplicate key '760/tcp' - skipping
yp_mkdb: duplicate key '761/tcp' - skipping
yp_mkdb: duplicate key '999/tcp' - skipping
yp_mkdb: duplicate key '999/udp' - skipping
yp_mkdb: duplicate key 'cadlock/tcp' - skipping
yp_mkdb: duplicate key 'csdmbase/tcp' - skipping
yp_mkdb: duplicate key 'csdmbase/udp' - skipping
yp_mkdb: duplicate key 'csdm/tcp' - skipping
yp_mkdb: duplicate key 'csdm/udp' - skipping
yp_mkdb: duplicate key '1525/tcp' - skipping
yp_mkdb: duplicate key '1525/udp' - skipping
yp_mkdb: duplicate key '1529/tcp' - skipping
yp_mkdb: duplicate key '1701/tcp' - skipping
yp_mkdb: duplicate key '1701/udp' - skipping
yp_mkdb: duplicate key '1989/tcp' - skipping
yp_mkdb: duplicate key '1989/udp' - skipping
yp_mkdb: duplicate key '1992/tcp' - skipping
yp_mkdb: duplicate key '1992/udp' - skipping
yp_mkdb: duplicate key '3455/udp' - skipping
yp_mkdb: duplicate key '4444/tcp' - skipping
yp_mkdb: duplicate key '4444/udp' - skipping
yp_mkdb: duplicate key '7010/tcp' - skipping
yp_mkdb: duplicate key '7010/udp' - skipping
yp_mkdb: duplicate key '22273/tcp' - skipping
yp_mkdb: duplicate key '22289/tcp' - skipping
yp_mkdb: duplicate key '22321/tcp' - skipping
yp_mkdb: duplicate key '22305/tcp' - skipping
Updating group.byname...
Updating group.bygid...
Updating passwd.byname...
Updating passwd.byuid...
Updating master.passwd.byname...
Updating master.passwd.byuid...
NIS Map update completed.

freebsd1.compulinux.org has been setup as an YP master
server without any errors

I then edit /var/vp/Makefile and make NOPUSH = TRUE to
#NOPUSH = TRUE
after that i normally reboot just to make sure all
changes have taken place. I then add users to the
system by typing

# freebsd1# adduser
Use option ``-silent'' if you don't want to see all
warnings and questions.

Check /etc/shells
Check /etc/master.passwd
Check /etc/group
User ``+'' has gid  but a group with this gid does not
exist.
Usernames must match regular expression: 
[^[a-z0-9_][a-z0-9_-]*$]: 
Enter your default shell: bash csh date no sh tcsh
[bash]: 
Your default shell is: bash -> /usr/local/bin/bash
Enter your default HOME partition: [/home]: 
Copy dotfiles from: /usr/share/skel no
[/usr/share/skel]: 
Send message from file: /etc/adduser.message no 
[/etc/adduser.message]: 
Use passwords (y/n) [y]: 

Ok, let's go.
Don't worry about mistakes. I will give you the chance
later to correct any input.
Enter username [^[a-z0-9_][a-z0-9_-]*$]: nutso
Enter full name []: 
Enter shell bash csh date no sh tcsh [bash]: 
Enter home directory (full path) [/home/nutso]: 
Uid [1001]: 
Enter login class: default []: 
Login group nutso [nutso]: 
Login group is ``nutso''. Invite nutso into other
groups: guest no 
[no]: wheel
Enter password []: 
Enter password again []: 

Name:     nutso
Password: ****
Fullname: nutso
Uid:      1001
Gid:      1001 (nutso)
Class:    
Groups:   nutso wheel
HOME:     /home/nutso
Shell:    /usr/local/bin/bash
OK? (y/n) [y]: 
Added user ``nutso''
Send message to ``nutso'' and: no root
second_mail_address 
[no]: 

nutso,

your account ``nutso'' was created.
Have fun!

See also chpass(1), finger(1), passwd(1)

Add anything to default message (y/n) [n]: 
Send message (y/n) [y]: 
Copy files from /usr/share/skel to /home/nutso
Add another user? (y/n) [y]: 
Enter username [^[a-z0-9_][a-z0-9_-]*$]: viril29
Enter full name []: 
Enter shell bash csh date no sh tcsh [bash]: 
Enter home directory (full path) [/home/viril29]: 
Uid [1004]: 
Enter login class: default []: 
Login group viril29 [viril29]: 
Login group is ``viril29''. Invite viril29 into other
groups: guest no wheel 
[wheel]: 
Enter password []: 
Enter password again []: 

Name:     viril29
Password: ****
Fullname: viril29
Uid:      1004

Due to the system not coping these two user to
/var/yp/master.passwd i manually copy then into
/var/yp/master.passwd Please let me know how to fix
that. after editing the /var/yp/passwd file i will
type in.

#make
NIS Map update started on Sun Mar 21 06:35:31 CST 2004
for domain compulinux.org
Updating group.byname...
yppush: transfer of map group.byname to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed group.byname map.
Updating group.bygid...
yppush: transfer of map group.bygid to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed group.bygid map.
Creating new /var/yp/passwd file from
/var/yp/master.passwd...
Updating netid.byname...
yppush: transfer of map netid.byname to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed netid.byname map.
Updating passwd.byname...
yppush: transfer of map passwd.byname to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed passwd.byname map.
Updating passwd.byuid...
yppush: transfer of map passwd.byuid to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed passwd.byuid map.
Updating master.passwd.byname...
yppush: transfer of map master.passwd.byname to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed master.passwd.byname map.
Updating master.passwd.byuid...
yppush: transfer of map master.passwd.byuid to server
freebsd1.compulinux.org failed
yppush: status returned by ypxfr: Master's version not
newer
Pushed master.passwd.byuid map.
NIS Map update completed.

I then goto the Slave server I edit /etc/rc.conf place
the following in it.
1. nisdomainname="compulinux.org"
2. nis_server_enable="YES"
3. nis_yppasswdd_enable="YES"
I then type in
freebsd2# ypinit -s freebsd1 compulinux.org

Server Type: SLAVE Domain: compulinux.org Master:
freebsd1

Creating an YP server will require that you answer a
few questions.
Questions will all be asked at the beginning of the
procedure.

Do you want this procedure to quit on non-fatal
errors? [y/n: n]  

Ok, please remember to go back and redo manually
whatever fails.
If you don't, something might not work. 
There will be no further questions. The remainder of
the procedure
should take a few minutes, to copy the databases from
freebsd1.
Transfering master.passwd.byuid...
ypxfr: Exiting: Map successfully transferred
Transfering passwd.byuid...
ypxfr: Exiting: Map successfully transferred
Transfering passwd.byname...
ypxfr: Exiting: Map successfully transferred
Transfering group.bygid...
ypxfr: Exiting: Map successfully transferred
Transfering group.byname...
ypxfr: Exiting: Map successfully transferred
Transfering services.byname...
ypxfr: Exiting: Map successfully transferred
Transfering rpc.bynumber...
ypxfr: Exiting: Map successfully transferred
Transfering rpc.byname...
ypxfr: Exiting: Map successfully transferred
Transfering protocols.byname...
ypxfr: Exiting: Map successfully transferred
Transfering master.passwd.byname...
ypxfr: Exiting: Map successfully transferred
Transfering networks.byname...
ypxfr: Exiting: Map successfully transferred
Transfering protocols.bynumber...
ypxfr: Exiting: Map successfully transferred
Transfering hosts.byaddr...
ypxfr: Exiting: Map successfully transferred
Transfering netid.byname...
ypxfr: Exiting: Map successfully transferred
Transfering hosts.byname...
ypxfr: Exiting: Map successfully transferred
Transfering networks.byaddr...
ypxfr: Exiting: Map successfully transferred
Transfering ypservers...
ypxfr: Exiting: Map successfully transferred

freebsd2.compulinux.org has been setup as an YP slave
server without any errors. 
Don't forget to update map ypservers on freebsd1.
I then edit /etc/contab and put the following in it.
20      *   *    *    *    root   /usr/libexec/ypxfr
passwd.byname
21      *   *    *    *    root   /usr/libexec/ypxfr
passwd.byuid

Then I reboot that system then goto freebsd3

I edit /etc/rc.conf placing 
1. nisdomainname="compulinux.org"
2. nis_client_enable="YES"
I edit /etc/master.passwd placing +::::::::: at the
end of the file
I edit /etc/group placing +:*:: at the end of the file
I then reboot that then run the commands

freebsd3# ypcat passwd
nutso:*:1001:1001:nutso:/home/nutso:/usr/local/bin/bash
viril29:*:1004:1004:viril29:/home/viril29:/usr/local/bin/bash
freebsd3# su nutso
su: unknown login: nutso
freebsd3# su viril29
su: unknown login: viril29

Please let me know what i am doing wrong.

Thank You
Jamel A. Brown


I e-mail the above to questions@freebsd.org  which
they replied by telling me to due the following  

I added portmap_enable="YES"  to /etc/rc.conf on all
hosts

freebsd1# rpcinfo
usage: rpcinfo [-n portnum] -u host prognum [versnum]
       rpcinfo [-n portnum] -t host prognum [versnum]
       rpcinfo -p [host]
       rpcinfo -b prognum versnum
       rpcinfo -d prognum versnum
freebsd1# rpcinfo -p freebsd1
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100004    1   udp   1021  ypserv
    100004    2   udp   1021  ypserv
    100004    1   tcp   1023  ypserv
    100004    2   tcp   1023  ypserv
    100009    1   udp   1011  yppasswdd
    100009    1   tcp   1022  yppasswdd
freebsd2# rpcinfo -p freebsd2
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100004    1   udp   1021  ypserv
    100004    2   udp   1021  ypserv
    100004    1   tcp   1023  ypserv
    100004    2   tcp   1023  ypserv
freebsd3# rpcinfo -p freebsd3
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100007    2   udp   1022  ypbind
    100007    2   tcp   1023  ypbind
    100005    3   udp   1018  mountd
    100005    3   tcp   1022  mountd
    100005    1   udp   1018  mountd
    100005    1   tcp   1022  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100024    1   udp   1006  status
    100024    1   tcp   1021  status
freebsd1# ypwhich
ypwhich: can't clntudp_create: Can't communicate with
ypbind

freebsd2# ypwhich
ypwhich: can't clntudp_create: Can't communicate with
ypbind

freebsd3# ypwhich
freebsd1.compulinux.org

freebsd1# ypcat passwd
ypcat: no such map passwd.byname. reason: Can't bind
to server which serves this domain

freebsd2# ypcat passwd
ypcat: no such map passwd.byname. reason: Can't bind
to server which serves this domain

freebsd3# ypcat passwd
nutso:*:1001:1001:nutso:/home/nutso:/usr/local/bin/bash
viril29:*:1004:1004:viril29:/home/viril29:/usr/local/bin/bash

I also ran 

freebsd1# pw usermod -n viril29 -m

freebsd1# pw usermod -n nutso -m

freebsd2# pw usermod -n nutso -m
pw: no such user `nutso'

freebsd2# pw usermod -n viril29 -m
pw: no such user `viril29'

freebsd3# pw usermod -n nusto -m 
pw: no such user `nusto'

freebsd3# pw usermod -n viril29 -m
pw: no such user `viril29'

But i still get 

freebsd3# su nutso
su: unknown login: nutso

freebsd3# su viril29
su: unknown login: viril29

When I try to login these accounts



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040324202325.95791.qmail>