root@dlp:~# vi /etc/default/nis # line 6: change (set NIS primary server) NISSERVER=master root@dlp:~# vi /etc/ypserv.securenets # This line gives access to everybody. PLEASE ADJUST! # comment out # 0.0.0.0 0.0.0.0 # add to the end: IP range you allow to access 255.255.255.0 10.0.0.0
root@dlp:~# vi /etc/hosts 127.0.0.1 localhost # add own IP address for NIS 10.0.0.30 dlp.srv.world dlp
root@dlp:~# systemctl restart rpcbind nis # update NIS database root@dlp:~# /usr/lib/yp/ypinit -m At this point, we have to construct a list of the hosts which will run NIS servers. dlp.srv.world is in the list of NIS server hosts. Please continue to add the names for the other hosts, one per line. When you are done with the list, type a <control D>. next host to add: dlp.srv.world next host to add: # Ctrl + D key The current list of NIS servers looks like this:
dlp.srv.world
Is this correct? [y/n: y] y We need a few minutes to build the databases... Building /var/yp/srv.world/ypservers... Running /var/yp/Makefile... make[1]: Entering directory '/var/yp/srv.world' Updating passwd.byname... Updating passwd.byuid... Updating group.byname... Updating group.bygid... Updating hosts.byname... Updating hosts.byaddr... Updating rpc.byname... Updating rpc.bynumber... Updating services.byname... Updating services.byservicename... Updating netid.byname... Updating protocols.bynumber... Updating protocols.byname... Updating netgroup... Updating netgroup.byhost... Updating netgroup.byuser... Updating shadow.byname... Ignored -> merged with passwd make[1]: Leaving directory '/var/yp/srv.world'
dlp.srv.world has been set up as a NIS master server.
Now you can run ypinit -s dlp.srv.world on all slave server.
root@node01:~# vi /etc/yp.conf # # yp.conf Configuration file for the ypbind process. You can define # NIS servers manually here if they can't be found by # broadcasting on the local net (which is the default). # # See the manual page of ypbind for the syntax of this file. # # IMPORTANT: For the "ypserver", use IP addresses, or make sure that # the host is in /etc/hosts. This file is only interpreted # once, and if DNS isn't reachable yet the ypserver cannot # be resolved and ypbind won't ever bind to the server.
# ypserver ypserver.network.com # add to the end: [domain name] [server] [NIS server's hostname] domain srv.world server dlp.srv.world root@node01:~# vi /etc/nsswitch.conf # line 7: add like follows passwd: files systemd nis group: files systemd nis shadow: files nis gshadow: files
hosts: files dns nis
#set follows if needed (create home directory automatically if none) root@node01:~# vi /etc/pam.d/common-session # add to the end session optional pam_mkhomedir.so skel=/etc/skel umask=077
11 updates can be installed immediately. 8 of these updates are security updates. To see these additional updates run: apt list --upgradable
The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
Creating directory '/home/focal'. focal@node01:~$ # just logined
# changing NIS password is like follows focal@node01:~$ yppasswd hanging NIS account information for focal on dlp.srv.world. Please enter old password: Changing NIS password for focal on dlp.srv.world. Please enter new password: Please retype new password:
The NIS password has been changed on dlp.srv.world.