Debian cluster construction ------ NIS Server Installation Configuration
0 Network Topology
Nis server: 192.168.16.2 nis client: 192.163.16.3
1. Server Configuration
Add test user
$ Sudo adduser nistest
Software Installation
$ Sudo aptitude update $ sudo aptitude install nis portmap
NIS Service Control
Start
$ Sudo/etc/init. d/nis start
Stop
$ Sudo/etc/init. d/nis stop
Restart
$ Sudo/etc/init. d/nis restart
Configuration
1. modify the configuration file/etc/defaultdomain as follows and set the NIS domain:
Nis
2. Run
$ Sudo domainname nis
3. modify the configuration file/etc/default/nis to make sure the following settings are set to the NIS master server.
NISSERVER = master NISCLIENT = true
4. Restart the service
/Etc/init. d/nis restart Starting NIS services: ypserv yppasswdd ypxfrd ypbind
Generate a ing File
You can use the make command to initialize the independent server and create an NIS ing table. The file/var/yp/Makefile contains the command for creating a database. You can edit Makefile to specify which ing tables the system is going to distribute. For example:
ALL = passwd group hosts rpc services netid protocols netgrp
Use the make command to initialize an independent server
$ Cd/var/yp $ sudo make
Test
Use the ypwhich command to test the connection with the server
$ Ypwhich 192.168.16.2
Security Configuration
In the configuration file/etc/ypserv. securenets, add the IP address range of the client that can be accessed, for example, allow access from all hosts in the 192.168.16.0/255.255.255.0 network segment.
255.0.0.0 127.0.0.0 255.255.255.0 192.168.16.0
Access Control of ing files
You can modify the main configuration file:/etc/ypserv. conf to set the access permission for the ing file.
Configuration File Syntax/format
<Set project >:< value> Because this time the target is relatively simple, all parameters are set by default:
# Host: Domain: Map: Security # *: passwd. byname: port/mangle # *: passwd. byuid: port/mangle # This is the default-restrict access to the shadow password file, # allow access to all others. *: shadow. byname: port *: passwd. adjunct. byname: port *: none
2. Client Configuration
Software Installation
$ Sudo aptitude update $ sudo aptitude install nis portmap
Configuration
1. modify the configuration file/etc/default/nis to make sure that the following settings are available and configured as the NIS client.
NISSERVER = falseNISCLIENT = true
2. Add the NIS Server record in the configuration file/etc/hosts.
192.168.16.2 nisserv
3. Modify/etc/defaultdomain as follows and set the NIS domain
Nis
4. Run the command
$ Sudo domainname nis
5. modify the configuration file/etc/yp. conf and add the following content to specify the NIS server to be used.
Ypserver nisserv
Or
Ypserver 192.168.16.2
6. Make sure that the entries in the configuration file/etc/nsswitch. conf, passwd, group, shadow, and netgroup are set as follows:
Passwd: compatgroup: compatshadow: compat
7. Add it to the end of the file/etc/passwd
+: (6 :)
8. Add it to the end of the file/etc/shadow.
+ :::::::: (8 :)
9. Add the following content to the end of the/etc/group file:
+: (3 :)
Client Test
1. Test with ypwhich
$ Ypwhichnisserv
2. Test with yptest
$ Yptest
3. Test with ypcat
$ Ypcat passwd
3. Use
Log on to the client using the server-side test user nistest. The system obtains information about the nistest user from the NIS server. The logon is successful:
Debian login: nistestPassword: Linux debian 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686The programs encoded with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in theindividual files in/usr/share/doc/*/copyright. debian GNU/Linux comes with absolutely no warranty, to the extentpermitted by applicable law. no directory, logging in with HOME =/nistest @ debian:/$