rhel6.5下安装NIS服务器

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34889607/article/details/80236400

test-env

hostname

ip

role

system

rhel

192.168.10.14

server

rhel6.5

client

192.168.10.13

client

centos7.4

setenforce 0
sed -i'/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
/etc/init.d/NetworkManagerstop
chkconfig NetworkManageroff
/etc/init.d/iptables stop
chkconfig iptables off

nis-server--->rhel

hostname rhel

vim/etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=rhel

# 相关安装软件

yum install -y ypservrpcbind yp-tools ypbind

# 设置nis域名

nisdomainname test

echo "nisdomainname test" >> /etc/rc.d/rc.local

# 修改相关配置文件

vim/etc/sysconfig/network
    NISDOMAINNAME=test
    YPSERV_ARGS="-p1011"

vim/etc/sysconfig/yppasswdd
    YPPASSWDD_ARGS="-p1012"

vim /etc/ypserv.conf
    127.0.0.0/255.255.255.0 :   *   :  *   :   none
    192.168.10.0/255.255.255.0  :   *  :   *   :  none
    *   :  *   :   *  :   deny

# 启动服务,开机自启动

/etc/init.d/ypserv start
/etc/init.d/yppasswddstart
/etc/init.d/rpcbind start
chkconfig ypserv on
chkconfig yppasswdd on
chkconfig rpcbind on

# 查看

rpcinfo -p localhost
rpcinfo -u localhostyppasswd

# 创建用户,指定家目录,设置密码

mkdir /home/guest
for i in `seq 1 5`;doecho "------create nisuser$i------";useradd -d /home/guest/nisuser$i-u 100$i nisuser$i;echo nis | passwd --stdin nisuser$i;done
tail /etc/passwd

# 生成库

/usr/lib64/yp/ypinit -m
make -C /var/yp/

# 测试

ypcat -h localhost passwd

nis-client--->client

hostnamectl set-hostnameclient
hostname client
bash

# 安装相关软件

yum install -y yp-toolsypbind
authconfig-tui

# 测试

 

su - nisuser1
id
yppasswd

 

没有更多推荐了,返回首页