中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

Linux下如何架設(shè)NIS服務(wù)器

2019-10-17    來源:愛站科技

容器云強(qiáng)勢上線!快速搭建集群,上萬Linux鏡像隨意使用

今天小編將為大家介紹Linux下NIS服務(wù)器的架設(shè),對于Linux下NIS服務(wù)器的架設(shè)相信很多小伙伴們都不是非常的了解,那么我們現(xiàn)在就一起跟小編去看看Linux下如何架設(shè)NIS服務(wù)器的內(nèi)容。

實(shí)驗(yàn)環(huán)境:AS4最小化安裝

實(shí)驗(yàn)?zāi)繕?biāo):架設(shè)NIS服務(wù)器

大家好!

這次我們來學(xué)習(xí)Linux系統(tǒng)中的NIS服務(wù)器的配置。主要目標(biāo)能夠使用nis服務(wù)器中的賬號登陸nis客戶機(jī)

NIS服務(wù)器IP192.168.1.10? hostname = crazylinux.nistest 該服務(wù)器下面有mike john2個(gè)賬號

NIS客戶機(jī)IP192.168.1.20

NIS初始配置:

首先配置NIS服務(wù)器:

1.檢查服務(wù)器是否安裝了下列包:portmap、ypserv、ypbind、yp-tools

ypserv在第一張安裝光盤中,

[root@crazylinux cdrom]# mount /media/cdrom/ 掛載

[root@crazylinux /]# rpm -ivh /media/cdrom/RedHat/RPMS/ypserv-2.13-5.i386.rpm

warning: /media/cdrom/RedHat/RPMS/ypserv-2.13-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing...??????????????? ########################################### [100%]

1:ypserv???????????????? ########################################### [100%]

[root@crazylinux /]# rpm -qa | grep portmap

portmap-4.0-63

[root@crazylinux /]# rpm -qa | grep ^yp

yp-tools-2.8-7

ypserv-2.13-5

ypbind-1.17.2-3

2.設(shè)置time和time-udp服務(wù)的啟動(dòng)狀態(tài)

[root@crazylinux /]# chkconfig --list | grep time? 默認(rèn)設(shè)置

time-udp:?????? off

daytime-udp:??? off

daytime:??????? off

time:?? off

[root@crazylinux /]# chkconfig time on

[root@crazylinux /]# chkconfig time-udp on

[root@crazylinux /]# service xinetd restart

Stopping xinetd: [? OK? ]

Starting xinetd: [? OK? ]

3.建立NIS的域名

[root@crazylinux /]# nisdomainname nistest

[root@crazylinux /]# cat /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

/bin/nisdomainname nistest? 添加這行使之開機(jī)運(yùn)行

修改/etc/sysconfig/network文件,增加此行:NISDOMAIN=nistest

4.設(shè)置ypserv服務(wù)的配置文件

把下面這些添加到/etc/ypserv.conf最后

127.0.0.0/255.255.255.0??? : *?????? : *??????????????? : none

192.168.1.0/255.255.255.0? : *?????? : *??????????????? : none

*?????????????????????? : *?????? : *??????????????? : deny

[root@ crazylinux /]# touch /etc/netgroup

[root@crazylinux /]#hostname crazylinux.nistest

[root@crazylinux /]# cat /var/yp/securenets?? 需要自己建立

host 127.0.0.1

255.255.255.0?? 192.168.1.0

5.啟動(dòng)相關(guān)服務(wù):

#service portmap restart

[root@crazylinux /]# service portmap status

portmap (pid 1649) is running...

[root@crazylinux /]# service ypserv start

Starting YP server services: [? OK? ]

[root@crazylinux /]# service yppasswdd start

Starting YP passwd service: [? OK? ]

[root@crazylinux /]# chkconfig --level 35 ypserv on

[root@crazylinux /]# chkconfig --level 35 yppasswdd on? 設(shè)置開機(jī)自動(dòng)運(yùn)行

6.初始化NIS數(shù)據(jù)庫:

[root@crazylinux /]# useradd user1

[root@crazylinux /]# passwd user1

#/usr/lib/yp/ypinit –m

此時(shí)會詢問是否有其他NIS服務(wù)器,如果沒有,則可以直接按Ctrl+D結(jié)束,并重啟ypserv服務(wù)。

#service ypserv restart

#service yppasswdd restart

同時(shí)檢查進(jìn)程是否正常運(yùn)行以及信息是否正確:ps –aux | grep yp???? tail /var/log/message

以下進(jìn)行客戶端上的配置:

1.確認(rèn)安裝以下包: ypbind、yp-tools默認(rèn)安裝了的

2.設(shè)置hosts文件

[root@localhost ~]# cat /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.1.10??????????? crazylinux??? NIS服務(wù)器的主機(jī)名

3.建立NIS域名

[root@crazylinux /]# nisdomainname nistest

[root@crazylinux /]# cat /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

/bin/nisdomainname nistest? 添加這行使之開機(jī)運(yùn)行

修改/etc/sysconfig/network文件,增加此行:NISDOMAIN=nistest

4.設(shè)置yp.conf

[root@localhost ~]# cat /etc/yp.conf

# generated by /sbin/dhclient-script

domain domain.org broadcast

domain? nistest???? 添加這句

ypserver crazylinux.nistest

在/etc/passwd最下面添加

+::::::

5.設(shè)置nsswitch.conf

vi? /etc/nsswitch.conf?? 修改為這樣

passwd:???? files nis nisplus

shadow:???? files nis nisplus

group:????? files nis nisplus

#hosts:???? db files nisplus nis dns

hosts:????? files nis dns

6.啟動(dòng)ypbind服務(wù)程序

[root@localhost ~]# service portmap status

portmap (pid 1683) is running...

[root@localhost ~]# service? ypbind start

Binding to the NIS domain: [? OK? ]

Listening for an NIS domain server..

在NIS服務(wù)器中輸出NFS共享目錄

在nis服務(wù)器上

[root@localhost ~]# vi /etc/exports 添加

/home???? 192.168.1.0/24(rw,async,np_root_squash)

[root@localhost ~]#service nfs start

在NIS客戶機(jī)上

[root@localhost ~]#vi /etc/fstab

Crazylinux.nistest:/home/?????? /home???? nfs?? defaults?? 0???? 0

現(xiàn)在在客戶機(jī)中用服務(wù)器里面的帳號登陸? 嘿嘿? OK

上文中介紹的Linux下如何架設(shè)NIS服務(wù)器的內(nèi)容你學(xué)會了嗎?linux系統(tǒng)還有更多豐富的功能和特性,可以幫助我們提高工作學(xué)習(xí)效率,有待朋友們多多發(fā)掘。

標(biāo)簽: Linux NIS服務(wù)器

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:如何查看Linux系統(tǒng)中DNS服務(wù)器的運(yùn)行狀況

下一篇:關(guān)于Linux下開放與關(guān)閉端口