当前位置: 移动技术网 > 科技>操作系统>windows > 在CentOS系统中安装NIS服务器的方法

在CentOS系统中安装NIS服务器的方法

2018年03月08日  | 移动技术网科技  | 我要评论

杠上皇室美男团,周岫,东宁县政府网

第一步 安装 nis 服务器


复制代码
代码如下:
[root@s ~]# yum install ypserv yp-tools rpcbind

这样就安装完成了,是不是很 easy

我这里的环境是:

nis 服务器 ip: 192.168.100.254  主机名: www.e2fsck.org

nis 客户端 ip: 192.168.100.240  主机名: site.e2fsck.org

 

第二步 配置 nis 服务器

1. 增加 nisdomain


复制代码
代码如下:
[root@s ~]# vi /etc/sysconfig/network</p> <p>nisdomain=e2fsck #这里的名字要和 hostname 一样

 

2. 启动 nis 服务


复制代码
代码如下:
[root@s ~]# service rpcbind start #如果是 centos 5 应该是 service portmap start</p> <p>[root@s ~]# service ypserv start

 

3. 限制ip范围


复制代码
代码如下:
[root@s ~]# vi /var/yp/securenets</p> <p>255.255.255.255 127.0.0.1
255.255.255.0 192.168.100.0

 

4. 添加测试用户


复制代码
代码如下:
[root@s ~]# useradd e2fsck</p> <p>[root@s ~]# passwd e2fsck

 

5. 建立数据库


复制代码
代码如下:
[root@s ~]# /usr/lib/yp/ypinit -m</p> <p>
at this point, we have to construct a list of the hosts which will run nis
&nbsp;servers. www.e2fsck.org is in the list of nis server hosts. please continue to add
&nbsp;the names for the other hosts, one per line. when you are done with the
&nbsp;list, type a .
&nbsp;next host to add: www.e2fsck.org
&nbsp; next host to add: <span id="comm">这里 ctrl + d 这里从服务器的地址,我们这里不用</span>
&nbsp;the current list of nis servers looks like this:
&nbsp;www.e2fsck.org
&nbsp;is this correct? [y/n: y] <span id="comm">y</span>
&nbsp;we need a few minutes to build the databases...
&nbsp;building /var/yp/e2fsck/ypservers...
&nbsp;running /var/yp/makefile...
&nbsp;gmake[1]: entering directory `/var/yp/e2fsck'
&nbsp;updating passwd.byname...
&nbsp;updating passwd.byuid...
&nbsp;updating group.byname...
&nbsp;updating group.bygid...
&nbsp;updating hosts.byname...
&nbsp;updating hosts.byaddr...
&nbsp;updating rpc.byname...
&nbsp;updating rpc.bynumber...
&nbsp;updating services.byname...
&nbsp;updating services.byservicename...
&nbsp;updating netid.byname...
&nbsp;updating protocols.bynumber...
&nbsp;updating protocols.byname...
&nbsp;updating mail.aliases...
&nbsp;gmake[1]: leaving directory `/var/yp/e2fsck'
&nbsp;www.e2fsck.org has been set up as a nis master server.
&nbsp;now you can run ypinit -s www.e2fsck.org on all slave server.
&nbsp;

6. 启动


复制代码
代码如下:
[root@s ~]# service yppasswdd start

 

第三步 客户端配置

1. 下载安装包


复制代码
代码如下:
[root@c2 ~]# yum install ypbind rpcbind

2. 图形方式认证


复制代码
代码如下:
[root@c2 ~]# authconfig-tui</p> <p>
authconfig-tui - (c) 1999-2005 red hat, inc.
┌───────┤ authentication configuration ├────—───|
│ user information authentication │
│ [ ] cache information [*] use md5 passwords │
│ [ ] use hesiod [*] use shadow passwords │
│ [ ] use ldap [ ] use ldap authentication │
│ [*] use nis [ ] use kerberos │
│ [ ] use winbind [ ] use smb authentication │
│ [ ] use winbind authentication │
│ [ ] local authorization is sufficient │
│ │
│ │ cancel │ │ next │ │

│ │
└─────────────────────────────────
&nbsp;

这里选择 use nis 然后下一步,domain写 e2fsck ;server 写ip 192.168.100.254 即可。

 

3. ssh测试

ssh 连接 192.168.100.240 用上面创建的 e2fsck 帐号查看是否登录。


复制代码
代码如下:
login as: e2fsck
e2fsck@www.e2fsck.org’s password:
could not chdir to home directory /home/e2fsck: no such file or directory
-bash-3.2$

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网