NIS服务器的配置过程

简介:

                         NIS服务器的配置过程

以前在做实验的过程中总结和写的一些教程的一些资料,一直没时间发布到博客上面,五一到了,终于有点时间发布啦!关于Linux上面还会有RHCE系列的学习笔记发表

NIS需要的软件包:rpm -ivh ypserv-2.13-5.i386.rpm
NIS的配置文件:/etc/ypserv.conf
NIS的守护进程:ypserv
1、按装rpm包
[root@cisco RPMS]# rpm -ivh ypserv-2.13-5.i386.rpm
warning: ypserv-2.13-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:ypserv ########################################### [100%]
2、开启time和time-udp服务,nis服务需要这两个服务的支持
[root@cisco RPMS]# chkconfig --list|grep time
time-udp: off
time: off
daytime: off
daytime-udp: off
[root@cisco RPMS]# chkconfig time on
[root@cisco RPMS]# chkconfig time-udp on
[root@cisco RPMS]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
3、设定NIS域名
[root@cisco RPMS]# nisdomainname nis-abc
[root@cisco RPMS]# vi /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
nisdominname nis-abc
"/etc/rc.d/rc.local" 8L, 242C
[root@cisco RPMS]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
NISDOMAIN=nis-abc
:wq
4、编辑主配置文件
[root@cisco ~]# vi /etc/ypserv.conf
127.0.0.0/255.255.255.0 : * : * : none
192.168.20.0/255.255.255.0 : * : * : none
* : * : * : deny
5、设置对NIS客户端主机的安全访问 www.wqmsl.cn
cat /var/yp/securenets
host 127.0.0.1
255.255.255.0 192.168.20.0
6.、创建账号和密码,用来验证
[root@cisco ~]# useradd cisco
[root@cisco ~]# passwd cisco
Changing password for user cisco.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
7、启动服务
[root@cisco ~]# service ypserv start
Starting YP server services: [ OK ]
8、构建NIS的数据库文件
[root@cisco ~]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. cisco 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: cisco
next host to add:
The current list of NIS servers looks like this:
cisco
Is this correct? [y/n: y]
We need a few minutes to build the databases...
Building /var/yp/nis-abc/ypservers...
gethostbyname(): Resource temporarily unavailable
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/nis-abc'
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 mail.aliases...
gmake[1]: Leaving directory `/var/yp/nis-abc'
cisco has been set up as a NIS master server.
Now you can run ypinit -s cisco on all slave server.
NIS客户端的配置过程
NIS客户端需要的软件包:ypbind-1.17.2-3
yp-tools-2.8-7
NIS客户端的配置文件:/etc/yp.conf
NIS客户端的守护进程:ypbind
1、查看是否安装了RPM包
[root@localhost ~]# rpm -qa |grep ^yp
ypbind-1.17.2-3
yp-tools-2.8-7
2、设置NIS的域名
[root@cisco RPMS]# nisdomainname nis-abc
[root@cisco RPMS]# vi /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
nisdominname nis-abc
"/etc/rc.d/rc.local" 8L, 242C
[root@cisco RPMS]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
NISDOMAIN=nis-abc
3、设置客户机的主配置文件
[root@localhost ~]# vi /etc/yp.conf
# generated by /sbin/dhclient-script
domain nis-abc server cisco
4、设置主机的HOSTS文件
[root@localhost ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.20.1 cisco
5、[root@localhost ~]# vi /etc/nsswitch.conf
passwd: files nis
shadow: files nis
group: files nis
6、启动服务ypbind服务程序
[root@localhost ~]# service portmap status
portmap (pid 1696) is running...
[root@localhost ~]# service ypbind start
Binding to the NIS domain: [ OK ]
Listening for an NIS domain server..
7、验证
[root@localhost ~]# yptest
Test 1: domainname
Configured domainname is "nis-abc"
Test 2: ypbind
Used NIS server: cisco
Test 3: yp_match
WARNING: No such key in map (Map passwd.byname, key nobody)
Test 4: yp_first
cisco cisco:$1$hvFanF6I$GB4qhFjJjfF2YMlUaJVa40:500:500::/home/cisco:/bin/bash
Test 5: yp_next
WARNING: Internal NIS error (Map passwd.byname)
Test 6: yp_master
cisco
Test 7: yp_order
1243581051
Test 8: yp_maplist
protocols.byname
ypservers
rpc.bynumber
hosts.byname
netid.byname
hosts.byaddr
passwd.byuid
passwd.byname
group.byname
rpc.byname
group.bygid
services.byservicename
services.byname
mail.aliases
protocols.bynumber
Test 9: yp_all
cisco cisco:$1$hvFanF6I$GB4qhFjJjfF2YMlUaJVa40:500:500::/home/cisco:/bin/bash
2 tests failed
[root@localhost ~]# ypwhich
cisco
[root@localhost ~]# ypwhich -x
Use "ethers" for map "ethers.byname"
Use "aliases" for map "mail.aliases"
Use "services" for map "services.byname"
Use "protocols" for map "protocols.bynumber"
Use "hosts" for map "hosts.byname"
Use "networks" for map "networks.byaddr"
Use "group" for map "group.byname"
Use "passwd" for map "passwd.byname"
[root@localhost ~]# ypcat -x
Use "ethers" for map "ethers.byname"
Use "aliases" for map "mail.aliases"
Use "services" for map "services.byname"
Use "protocols" for map "protocols.bynumber"
Use "hosts" for map "hosts.byname"
Use "networks" for map "networks.byaddr"
Use "group" for map "group.byname"
Use "passwd" for map "passwd.byname"

 

有NIS的RHCE的课程图文讲解,请大家关注"RHCE全程学习笔记"哦

大家一起交流学习  一起进步




     本文转自 wqmsl 51CTO博客,原文链接:http://blog.51cto.com/wqmsl/307942,如需转载请自行联系原作者


相关文章
|
1月前
HAProxy的高级配置选项-配置haproxy支持https协议及服务器动态上下线
文章介绍了如何配置HAProxy以支持HTTPS协议和实现服务器的动态上下线。
82 8
HAProxy的高级配置选项-配置haproxy支持https协议及服务器动态上下线
|
1月前
|
监控 Apache
HAProxy的高级配置选项-Web服务器状态监测
这篇文章介绍了HAProxy的高级配置选项,特别是如何进行Web服务器状态监测,包括基于四层传输端口监测、基于指定URI监测和基于指定URI的request请求头部内容监测三种方式,并通过实战案例展示了配置过程和效果。
51 8
HAProxy的高级配置选项-Web服务器状态监测
|
16天前
|
Ubuntu Linux
Linux服务器的自动启动可以在哪里进行配置?
Linux服务器的自动启动可以在哪里进行配置?
72 3
|
2月前
|
存储 弹性计算 负载均衡
阿里云服务器地域、实例、带宽与操作系统等配置选择指南参考
在数字化时代,无论是个人博客、企业官网、APP后端支持,还是小程序运行或者其他项目,云服务器都扮演着至关重要的角色,考虑产品质量、服务和价格等因素,大家现在都喜欢选择阿里云服务器。然而,对于初次接触云服务的新手来说,可能并不是很清楚应该如何选阿里云服务器的地域、实例、带宽与操作系统等配置。本文将从地域选择、实例规格、操作系统、云盘配置、购买时长以及带宽选择等六个方面,为新手用户提供详细的选购指南,以供参考。
阿里云服务器地域、实例、带宽与操作系统等配置选择指南参考
|
27天前
|
监控 应用服务中间件
Nagios 服务器 Nrpe 配置
Nagios服务器需安装NRPE并定义监控命令于`command.cfg`中。示例配置如下:`check_nrpe -H $HOSTADDRESS$ -c $ARG1$`。客户端配置文件如`192.168.149.128.cfg`可引用NRPE配置的命令,如`check_nrpe!check_load`以监控负载。监控HTTP关键词使用`check_http`命令加参数,如`-I`指定IP,`-u`指定URL,`-s`指定关键词,可在`command.cfg`中定义如`check_http_word`命令,并在主机配置文件中引用。
44 13
|
1月前
|
编解码 小程序
无影云电脑产品使用黑神话悟空之:游戏服务器更新/配置问题
该文档主要介绍了使用无影云电脑玩《黑神话:悟空》时可能遇到的问题及解决方法,包括游戏服务器更新、配置问题、画质建议及如何开启帧数显示等内容,并提供了详细的步骤指导与参考链接。
|
2月前
|
关系型数据库 MySQL Linux
在Linux中,如何配置数据库服务器(如MySQL或PostgreSQL)?
在Linux中,如何配置数据库服务器(如MySQL或PostgreSQL)?
|
2月前
|
Ubuntu 应用服务中间件 Linux
在Linux中,如何配置Web服务器(如Apache或Nginx)?
在Linux中,如何配置Web服务器(如Apache或Nginx)?
|
2月前
|
安全 Ubuntu 网络协议
在Linux中,如何配置DHCP服务器?
在Linux中,如何配置DHCP服务器?
|
2月前
|
域名解析 网络协议 Linux
在Linux中,如何配置DNS服务器?
在Linux中,如何配置DNS服务器?
下一篇
无影云桌面