강좌
클라우드/리눅스에 관한 강좌입니다.
리눅스 분류

리눅스서버 NFS와 NIS실무활용 2편- NIS편

작성자 정보

  • 관리자 작성
  • 작성일

컨텐츠 정보

본문

 목차 
 1. 리눅스와 NIS서버

 2. NIS 마스터서버, NIS 슬레이브서버, NIS 클라이언트

 3. NIS 마스터서버 (NIS Master Server) 설정하기

 4. NIS 슬레이브 서버 (NIS Slave Server) 설정하기

 5. NIS 클라이언트(NIS Client) 설정하기

 6. NIS 데몬들 실무다루기

 7. NIS 명령어 실무다루기

 



1. 리눅스와 NIS서버

 

NIS(Network Information Service) RPC(Remote Procedure Call)환경에서 동일한 NIS도메인(인터넷 도메인이 아님.)을 사용하는 호스트들간의 네트웍자원(호스트명, 사용자계정, 패스워드, 그룹정보,알리아스정보등)을 공유할 수 있는 Server/Client 서비스입니다.

 

1980년대 후반 SUN사에서 NFS와 함께 개발되어 현재는 Linux, UNIX, Solaris, AIX등의 거의 모든 유닉스계열 운영체제에서 사용하고 있습니다

 

NIS NIS마스터서버(Master Server) NIS슬레이브서버(Slave Server) 그리고 NIS 클라이언트(Client)로 구성되며 이들은 모두 동일한 NIS도메인을 가져야만 합니다.

 

NIS에서는 무엇보다도 NIS도메인이란 개념을 정확하게 이해해야 합니다


, NIS를 이용하여 네트웍정보를 공유하려면 Master Server, Slave Server, Client들이 모두 동일한 NIS도메인을 사용해야합니다


여기서 말하는 NIS도메인은 우리가 흔히 말하는 인터넷도메인과는 그 의미가 완전히 다른 것입니다. 호스트명, 사용자명등의 동일한 네트웍자원을 공유할 수 있는 일종의 네트웍 영역을 의미합니다.  


쉽게 표현한다면 동일한 네트웍자원을 공유할 수 있는 호스트들의 그룹이름이라고 할 수 있습니다


이런 개념에서 본다면 윈도우NT서버나 윈도우 2000서버등에서 의미하는 도메인의 개념과 거의 유사하다고 할 수 있습니다.

 

결론적으로 NIS도메인이란 NIS마스트서버와 슬레이브서버에서 보유한 NIS데이터베이스정보(동일한 네트웍자원)를 함께 사용하고 공유하는 호스트(컴퓨터)들의 그룹이름입니다.

 

그리고 NIS도메인명은 NIS Master Server, NIS Slave Server, NIS Client모두에 설정이 되어야하며 그 이름 또한 동일해야합니다.  

 

 

NIS서비스는 RPC환경에서 서비스가 된다고 하였는데 리눅스에서는 portmap을 실행시키면 RPC를 이용할 수 있기 때문에 반드시 portmap데몬을 실행해야만 합니다.

 

 

 

2 NIS 마스터서버, NIS 슬레이브서버, NIS 클라이언트

 

NIS NIS Master Server NIS Slave Server, 그리고 NIS Client들과 이들이 사용하는 NIS데이터베이스(NIS)정보들로 구성되어 있습니다


, Master Server Slaver Server NIS 데이터베이스를 가지고 NIS Client에게 정보를 제공하는 역할을 합니다.


 NIS Client들은 NIS Master/Slave Server들로부터 NIS 데이터베이스를 이용하는 호스트입니다.

 

그리고 Master Server Slave Server는 동일한 NIS 데이터베이스를 유지하기 위하여 업데이트되는 정보를 상호 교환하면서 데이터의 무결성을 유지하려고 노력합니다.

 

필자는 NIS서비스의 실제예를 위하여 다음과 같이 가정하도록 하겠습니다.

 

구분

NIS마스터서버

NIS슬레이브서버

NIS클라이언트

NIS도메인

superuser

superuser

superuser

IP주소

192.168.0.111

192.168.0.100

192.168.0.110

도메인명

command.superuser.co.kr

file.superuser.co.kr

bible.superuser.co.kr

호스트명

command

file

Bible

실행할 데몬들

ypbind
ypserv
yppasswdd
ypxfrd
portmap

ypbind
ypserv
ypxfrd
portmap

ypbind
portmap


위의표에서 보다시피 다음사항을 참고하시기 바랍니다.

. ypbind master, slave, client모두에 실행되어야 합니다.

. ypserv NIS서버(master, slave)에만 실행되어야 합니다.
. yppasswdd
master서버에서 실행해야 합니다.

 

 

 

3.NIS 마스터서버 (NIS Master Server) 설정하기

 

NIS데이터베이스의 마스터맵(master map)을 가지고 있는 서버로서 마스터맵을 업데이트하고 유지관리합니다. NIS마스터서버는 NIS클라이언트에게 NIS데이터베이스에 보관하고 있는 정보들을 제공하는 역할을 하는 주된 서버입니다.

 

NIS Master Server의 주된 역할과 목적을 간단히 나열하면 다음과 같습니다.

 

- NIS 데이터베이스 Master Map을 가지고 있습니다.

        - NIS Master Map을 업데이트하고 유지관리합니다.

        - NIS Master Map정보를 NIS Slave Server에게 제공합니다.

        - 동일한 NIS 도메인을 사용하는 NIS Client들에게 NIS서비스를 제공합니다.

        - NIS Master Server에는 ypserv ypbind데몬이 실행되어 있어야합니다.

 

 

NIS Master Server 셋팅하기

 

     - “nisdomainname NIS도메인명과 같은 명령어로 NIS도메인을 설정합니다.
        (
설정된 NIS도메인명은 “nisdomainname”으로 확인할 수 있습니다.)

     - “/usr/lib/yp/ypinit -m”를 실행하여 NIS마스터서버환경설정을합니다.
여기서 NIS Slave Server로 사용할 서버들을 등록합니다.

     - “/etc/rc.d/init.d/ypserv start를 실행합니다.

     - “/etc/rc.d/init.d/ypbind start”를 실행합니다.

     - “/etc/rc.d/init.d/ypxfrd start”를 실행합니다.

 

다음은 필자가 사용하고 있는 192.168.0.111서버를 NIS마스터서버로 설정한 내용입니다.

 

1단계 : ypserv패키지와 ypbind패키지를 설치


2.
단계 : NIS도메인등록


[root@command yp]# nisdomainname superuser

[root@command yp]#

[root@command yp]# nisdomainname

superuser

[root@command yp]#

 

3단계 : /etc/ypserv.conf파일 설정확인 및 수정


[root@command yp]# cat /etc/ypserv.conf

#

# ypserv.conf   In this file you can set certain options for the NIS server,

#               and you can deny or restrict access to certain maps based

#               on the originating host.

#

#               See ypserv.conf(5) for a description of the syntax.

#

 

# Some options for ypserv. This things are all not needed, if

# you have a Linux net.

 

# Should we do DNS lookups for hosts not found in the hosts table ?

# This option is ignored in the moment.

dns: no

 

# How many map file handles should be cached ?

files: 30

 

# xfr requests are only allowed from ports < 1024

xfr_check_port: yes

 

# The following, when uncommented,  will give you shadow like passwords.

# Note that it will not work if you have slave NIS servers in your

# network that do not run the same server as you.

 

# Host                     : Domain  : Map              : Security

#

# *                        : *       : passwd.byname    : port

# *                        : *       : passwd.byuid     : port

 

# Not everybody should see the shadow passwords, not secure, since

# under MSDOG everbody is root and can access ports < 1024 !!!

*                          : *       : shadow.byname    : port

*                          : *       : passwd.adjunct.byname : port

 

# If you comment out the next rule, ypserv and rpc.ypxfrd will

# look for YP_SECURE and YP_AUTHDES in the maps. This will make

# the security check a little bit slower, but you only have to

# change the keys on the master server, not the configuration files

# on each NIS server.

# If you have maps with YP_SECURE or YP_AUTHDES, you should create

# a rule for them above, that's much faster.

# *                        : *       : *                : none

 

[root@command yp]#

 

4단계 : /etc/yp.conf파일 설정확인 및 수정

[root@command init.d]# cat /etc/yp.conf

# /etc/yp.conf - ypbind configuration file

# Valid entries are

#

domain superuser server command.superuser.co.kr

#       Use server HOSTNAME for the domain NISDOMAIN.

#

domain superuser broadcast

#       Use  broadcast  on  the local net for domain NISDOMAIN

#

ypserver command.superuser.co.kr

#       Use server HOSTNAME for the  local  domain.  The

#       IP-address of server must be listed in /etc/hosts.

#

[root@command init.d]#

 

5단계 : /etc/rc.d/init.d/portmap start 실행


[root@command root]# /etc/rc.d/init.d/portmap start

Starting portmapper: [  OK  ]

[root@command root]#

 

6단계 : /etc/rc.d/init.d/ypxfrd start를 실행


[root@command init.d]# /etc/rc.d/init.d/ypxfrd start

Starting YP map server: [  OK  ]

[root@command init.d]#

 

7단계 : /etc/rc.d/init.d/yppasswdd start를 실행


[root@command init.d]# /etc/rc.d/init.d/yppasswdd start

Starting YP passwd service: [  OK  ]

[root@command init.d]#

 

8단계 : /etc/rc.d/init.d/ypserv start를 실행


[root@command yp]# /etc/rc.d/init.d/ypserv start

Starting YP server services: [  OK  ]

[root@command yp]#


9
단계 : /etc/rc.d/init.d/ypbind start 실행


[root@command yp]# /etc/rc.d/init.d/ypbind start

Binding to the NIS domain: [  OK  ]

Listening for an NIS domain server.

[root@command yp]#

 

10단계 : “/usr/lib/yp/ypinit -m”으로 마스터서버 설정


[root@command yp]# /usr/lib/yp/ypinit -m

 

At this point, we have to construct a list of the hosts which will run NIS

servers.  command.superuser.co.kr 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:  command.superuser.co.kr

        next host to add:  bible.superuser.co.kr

        next host to add:  file.superuser.co.kr

        next host to add:  ^D

The current list of NIS servers looks like this:

 

command.superuser.co.kr

bible.superuser.co.kr

file.superuser.co.kr

 

Is this correct?  [y/n: y]  y

We need a few minutes to build the databases...

Building /var/yp/superuser/ypservers...

Running /var/yp/Makefile...

gmake[1]: Entering directory `/var/yp/superuser'

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/superuser'

 

command.superuser.co.kr has been set up as a NIS master server.

 

Now you can run ypinit -s command.superuser.co.kr on all slave server.

[root@command yp]#

 

11단계 : rpcinfo -p명령어로 NIS서비스 데몬들 실행여부를 확인
 

아래 결과에서 확인하실 데몬들은 yp관련 데몬들입니다 즉, ypserv ypbind등입니다.

 

[root@command yp]# rpcinfo -p

   program vers proto   port

    100000    2   tcp    111  portmapper

    100000    2   udp    111  portmapper

    100024    1   udp  32768  status

    100024    1   tcp  32768  status

    391002    2   tcp  32769  sgi_fam

    100011    1   udp    685  rquotad

    100011    2   udp    685  rquotad

    100011    1   tcp    688  rquotad

    100011    2   tcp    688  rquotad

    100003    2   udp   2049  nfs

    100003    3   udp   2049  nfs

    100021    1   udp  32770  nlockmgr

    100021    3   udp  32770  nlockmgr

    100021    4   udp  32770  nlockmgr

    100005    1   udp  32771  mountd

    100005    1   tcp  33719  mountd

    100005    2   udp  32771  mountd

    100005    2   tcp  33719  mountd

    100005    3   udp  32771  mountd

    100005    3   tcp  33719  mountd

    100009    1   udp    775  yppasswdd

 600100069    1   udp    687  fypxfrd

 600100069    1   tcp    689  fypxfrd

    100004    2   udp    837  ypserv

    100004    1   udp    837  ypserv

    100004    2   tcp    840  ypserv

    100004    1   tcp    840  ypserv

    100007    2   udp    679  ypbind

    100007    1   udp    679  ypbind

    100007    2   tcp    682  ypbind

    100007    1   tcp    682  ypbind

[root@command yp]#

 

12단계 : 시스템 재부팅시 적용설정하기


/etc/rc.d/rc.local파일에 NIS마스터서버 관련 실행 설정을 하십시요. 그리고 ntsysv NIS마스터서버관련 실행데몬 시작하기설정하시기 바랍니다.

 

 

4. NIS슬레이브 서버 (NIS Slave Server) 설정하기

 

NIS Slaver Server NIS Master Server로부터  NIS데이터베이스를 제공받아서 동일한 복사본을 보관하고 있는 서버로서 NIS Master Server와 마찬가지로 NIS클라이언트에게 NIS데이터베이스에 보관하고 있는 정보들을 제공하는 역할을 합니다.

 

NIS Client NIS Master Server NIS Slave Server를 구분하지않으며,  NIS정보요청을 하였을 때 가장 빠르고 적절한 응답을 하는 서버의 서비스를 이용합니다. 따라서 NIS Slave Server NIS Master Server가 다운되었거나 부하가 많을 경우에 NIS서비스의 신뢰성을 확보하고 NIS서비스의 연속성을 보장하기위한 서버입니다.

 

NIS Slave Server의 주된 역할과 목적을 간단히 나열하면 다음과 같습니다.

 

- NIS 마스터서버로부터 복사본을 가져와 보관합니다.

- 동일한 NIS도메인을 사용하는 NIS Client에게 NIS서비스를 합니다.

- NIS Slave Server에는 ypserv ypbind데몬이 실행되어 있어야합니다.

 

NIS Slave Server 셋팅하기

 

     - “nisdomainname NIS도메인명과 같은 명령어로 NIS도메인을 설정합니다.
        (
설정된 NIS도메인명은 “nisdomainname”으로 확인할 수 있습니다.)

     - “/etc/rc.d/init.d/ypserv start를 실행합니다.

     - “/etc/rc.d/init.d/ypbind start”를 실행합니다.

     - “/usr/lib/yp/ypinit -s NIS마스터서버를 실행합니다. 

 

다음은 필자가 사용하고 있는 192.168.0.100서버를 NIS슬레이브서버로 설정한 내용입니다.

 

1단계 : ypserv패키지와 ypbind패키지를 설치


2.단계 : NIS도메인등록


[root@file yp]# nisdomainname superuser

[root@file yp]#

[root@file yp]# nisdomainname

superuser

[root@file yp]#

 

3단계 : /etc/ypserv.conf파일 설정확인 및 수정


[root@file yp]# cat /etc/ypserv.conf

#

# ypserv.conf   In this file you can set certain options for the NIS server,

#               and you can deny or restrict access to certain maps based

#               on the originating host.

#

#               See ypserv.conf(5) for a description of the syntax.

#

 

# Some options for ypserv. This things are all not needed, if

# you have a Linux net.

 

# Should we do DNS lookups for hosts not found in the hosts table ?

# This option is ignored in the moment.

dns: no

 

# How many map file handles should be cached ?

files: 30

 

# xfr requests are only allowed from ports < 1024

xfr_check_port: yes

 

# The following, when uncommented,  will give you shadow like passwords.

# Note that it will not work if you have slave NIS servers in your

# network that do not run the same server as you.

 

# Host                     : Domain  : Map              : Security

#

# *                        : *       : passwd.byname    : port

# *                        : *       : passwd.byuid     : port

 

# Not everybody should see the shadow passwords, not secure, since

# under MSDOG everbody is root and can access ports < 1024 !!!

*                          : *       : shadow.byname    : port

*                          : *       : passwd.adjunct.byname : port

 

# If you comment out the next rule, ypserv and rpc.ypxfrd will

# look for YP_SECURE and YP_AUTHDES in the maps. This will make

# the security check a little bit slower, but you only have to

# change the keys on the master server, not the configuration files

# on each NIS server.

# If you have maps with YP_SECURE or YP_AUTHDES, you should create

# a rule for them above, that's much faster.

# *                        : *       : *                : none

 

[root@file yp]#

 

4단계 : /etc/yp.conf파일 설정확인 및 수정


[root@file yp]# cat /etc/yp.conf

# /etc/yp.conf - ypbind configuration file

# Valid entries are

#

domain superuser server file.superuser.co.kr

#       Use server HOSTNAME for the domain NISDOMAIN.

#

domain superuser broadcast

#       Use  broadcast  on  the local net for domain NISDOMAIN

#

ypserver file.superuser.co.kr

#       Use server HOSTNAME for the  local  domain.  The

#       IP-address of server must be listed in /etc/hosts.

#

[root@file yp]#

 

5단계 : /etc/rc.d/init.d/portmap start를 실행


[root@file root]# /etc/rc.d/init.d/portmap start

Starting portmapper: [  OK  ]

[root@file root]#

 

6단계 : /etc/rc.d/init.d/ypserv start를 실행


[root@file yp]# /etc/rc.d/init.d/ypserv start

Starting YP server services: [  OK  ]

[root@file yp]#

 

7단계 : /etc/rc.d/init.d/ypbind start 실행


[root@file yp]# /etc/rc.d/init.d/ypbind start

Binding to the NIS domain: [  OK  ]

Listening for an NIS domain server.

[root@file yp]#

 

8단계 : “/usr/lib/yp/ypinit -s command.superuser.co.kr”으로 마스터서버를 지정하여 슬레이브서버 설정


[root@file yp]# /usr/lib/yp/ypinit -s command.superuser.co.kr

We will need a few minutes to copy the data from command.superuser.co.kr.

Transferring mail.aliases...

Trying ypxfrd ... success

 

Transferring protocols.bynumber...

Trying ypxfrd ... success

 

Transferring services.byservicename...

Trying ypxfrd ... success

 

Transferring netid.byname...

Trying ypxfrd ... success

 

Transferring services.byname...

Trying ypxfrd ... success

 

Transferring rpc.bynumber...

Trying ypxfrd ... success

 

Transferring rpc.byname...

Trying ypxfrd ... success

 

Transferring hosts.byaddr...

Trying ypxfrd ... success

 

Transferring hosts.byname...

Trying ypxfrd ... success

 

Transferring group.bygid...

Trying ypxfrd ... success

 

Transferring group.byname...

Trying ypxfrd ... success

 

Transferring passwd.byname...

Trying ypxfrd ... success

 

Transferring protocols.byname...

Trying ypxfrd ... success

 

Transferring ypservers...

Trying ypxfrd ... success

 

Transferring passwd.byuid...

Trying ypxfrd ... success

 

 

file.superuser.co.kr's NIS data base has been set up.

If there were warnings, please figure out what went wrong, and fix it.

 

At this point, make sure that /etc/passwd and /etc/group have

been edited so that when the NIS is activated, the data bases you

have just created will be used, instead of the /etc ASCII files.

[root@file yp]#

 

9단계 : rpcinfo -p명령어로 NIS서비스 데몬들 실행여부를 확인


아래 결과에서 확인하실 데몬들은 yp관련 데몬들입니다 즉, ypserv ypbind등입니다.

 

[root@file yp]# rpcinfo -p

    program vers proto   port

    100000    2   tcp    111  portmapper

    100000    2   udp    111  portmapper

    100024    1   udp  32768  status

    100024    1   tcp  32768  status

    391002    2   tcp  32769  sgi_fam

    100011    1   udp    990  rquotad

    100011    2   udp    990  rquotad

    100011    1   tcp    993  rquotad

    100011    2   tcp    993  rquotad

    100003    2   udp   2049  nfs

    100003    3   udp   2049  nfs

    100021    1   udp  32779  nlockmgr

    100021    3   udp  32779  nlockmgr

    100021    4   udp  32779  nlockmgr

    100005    1   udp  32780  mountd

    100005    1   tcp  32770  mountd

    100005    2   udp  32780  mountd

    100005    2   tcp  32770  mountd

    100005    3   udp  32780  mountd

    100005    3   tcp  32770  mountd

    100009    1   udp    729  yppasswdd

    100004    2   udp    751  ypserv

    100004    1   udp    751  ypserv

    100004    2   tcp    754  ypserv

    100004    1   tcp    754  ypserv

 600100069    1   udp    884  fypxfrd

 600100069    1   tcp    886  fypxfrd

[root@file yp]#

 

10단계 : 시스템 재부팅시 적용설정 

 

방금 설정한 내용들이 NIS슬레이브서버에서 부팅시 매번 적용되도록 하기위하여/etc/rc.d/rc.local파일에 NIS슬레이브서버 관련 실행 설정을 하십시요


그리고 ntsysv NIS슬레이브서버관련 실행데몬을 시작하도록 *표를 하시기 바랍니다.

 

 

 

5. NIS 클라이언트(NIS Client) 설정하기

 

NIS클라이언트란 NIS Master Server 또는 NIS Slave Server로부터 NIS 데이터베이스정보를 제공받아서 사용하는 호스트를 의미합니다. NIS Server들로부터 NIS데이터베이스 정보를 제공받기 위해서는 NIS Server들과 동일한 NIS도메인을 가져야하며 ypbind데몬이 실행되어 있어야합니다. NIS클라이언트 시스템의 ypbind NIS데이터베이스의 정보를 이용하기 위하여 가장빠른 응답을 하는 NIS서버를 찾기 위하여 브로드캐스팅 송신을 합니다. 가장 빠른 응답을 한 NIS서버가 NIS클라이언트와 바이딩(binding)됩니다. 한번 binding이 되고나면 NIS클라이이언트의 ypbind는 응답한 NIS서버정보를 저장해 두기 때문에 통신이 가능한 한 계속해서 동일한 NIS서버에게 NIS서비스를 요청할 것입니다.

 

NIS Client 셋팅하기

 

- “nisdomainname NIS도메인명과 같은 명령어로 NIS도메인을 설정합니다.
        (
설정된 NIS도메인명은 “nisdomainname”으로 확인할 수 있습니다.)

     - “/etc/rc.d/init.d/ypbind start”를 실행합니다.

     - 참고로 NIS클라이언트에서 NIS서버의 정보(NIS 데이터베이스)를 이용할 때에는 “ypcat”명령어를 이용합니다.

 

다음은 필자가 사용하고 있는 192.168.0.110서버를 NIS클라이언트로 설정한 내용입니다.

 

1단계 : NIS도메인을 설정


[root@bible root]# nisdomainname superuser

[root@bible root]#

[root@bible root]# nisdomainname

superuser

[root@bible root]#

 

2단계 : /etc/rc.d/init.d/portmap start를 실행

 

[root@bible root]# /etc/rc.d/init.d/portmap start

Starting portmapper: [  OK  ]

[root@bible root]#

 

3단계 : /etc/rc.d/init.d/ypbind를 실행


[root@bible root]# /etc/rc.d/init.d/ypbind start

Binding to the NIS domain: [  OK  ]

Listening for an NIS domain server.

[root@bible root]#

 

4단계 : 시스템 재부팅시에 적용설정하기  


방금 설정한 NIS클라이언트에서 부팅시 매번 적용되도록 하기 위하여 /etc/rc.d/rc.local파일에 NIS클라이언트 관련 실행 설정을 하시기 바랍니다. 그리고 ntsysv NIS클라이언트관련 데몬이 실행되도록 *를 하시기 바랍니다.

 

 


 

6. NIS 데몬들 실무다루기

 

NIS서비스의 주된 서버데몬 ypserv 데몬

 

ypserv 데몬은 NIS의 주된 데몬입니다. 이 데몬을 설치하시려면 ypserv-2.6-2패키지를 설치하면 됩니다.  ypserv패키지 설치시에 생성되는 주요파일들은 다음과 같습니다.

 

/etc/rc.d/init.d/yppasswdd

/etc/rc.d/init.d/ypserv

/etc/rc.d/init.d/ypxfrd

/etc/sysconfig/yppasswdd

/etc/ypserv.conf

/usr/include/rpcsvc/ypxfrd.x

/usr/lib/yp

/usr/lib/yp/create_printcap

/usr/lib/yp/makedbm

/usr/lib/yp/match_printcap

/usr/lib/yp/mknetid

/usr/lib/yp/pwupdate

/usr/lib/yp/revnetgroup

/usr/lib/yp/yphelper

/usr/lib/yp/ypinit

/usr/lib/yp/ypxfr

/usr/lib/yp/ypxfr_1perday

/usr/lib/yp/ypxfr_1perhour

/usr/lib/yp/ypxfr_2perday

/usr/sbin/rpc.yppasswdd

/usr/sbin/rpc.ypxfrd

/usr/sbin/yppush

/usr/sbin/ypserv

/var/yp

/var/yp/Makefile

 

ypserv NIS서버데몬으로서 NIS마스터서버와 NIS슬레이브서버에 모두 실행이 되어야하는 NIS서비스의 주된 서버데몬입니다


, NIS클라이언트의 ypbind데몬에 의한 서비스요청에 응답하고 서비스하는 주된 NIS서버데몬입니다. 또한 NIS서버와 NIS클라이언트는 모두 동일한 NIS도메인을 사용해야하며 RPC(Remote Procedure Call) 기반으로 통신이 이루어집니다.

 

데몬실행방법             : /usr/sbin/ypserv [-b][-d[path]][-p port]

일반적인 데몬실행방법    : /etc/rc.d/init.d/ypserv start

다음은 NIS마스터서버에서 ypserv데몬을 실행하고 실행확인한 예입니다


, 다음 예와  같이 ypserv 실행하려면 /etc/rc.d/init.d/ypserv스크립트를 이용하시면 됩니다.

 

[root@command yp]# /etc/rc.d/init.d/ypserv start

Starting YP server services: [  OK  ]

[root@command yp]#

[root@command init.d]# ps -ef | grep ypserv

root      2416     1  0 00:02 ?        00:00:00 ypserv

root      2755  1880  0 00:48 pts/0    00:00:00 grep ypserv

[root@command init.d]#

 

위의 예는 NIS마스터서버에서 “/etc/rc.d/init.d/ypserv start” 실행하여 ypserv 데몬을 실행하고 ps명령어로 확인한 예입니다.

 

다음은 NIS슬레이브서버에서 ypserv데몬을 실행하고 실행확인한 예입니다.

 

[root@file yp]# /etc/rc.d/init.d/ypserv start

Starting YP server services: [  OK  ]

[root@file yp]#

[root@file root]# ps -ef | grep ypserv

root      1962     1  0 11:18 ?        00:00:00 ypserv

root      2010  1918  0 11:45 pts/0    00:00:00 grep ypserv

[root@file root]#

 

위의 예는 NIS슬레이브서버에서 “/etc/rc.d/init.d/ypserv start” 실행하여 ypserv 데몬을 실행하고 ps명령어로 확인한 예입니다.

 

 

NIS서버와 NIS클라이언트의 바이딩 역할을 하는 ypbind 데몬

 

ypbind 데몬은 ypbind-1.11-4패키지를 설치하면 됩니다. ypbind패키지 설치시에 생성되는 주요 파일들은 다음과 같습니다.

 

/etc/rc.d/init.d/ypbind

/etc/yp.conf

/sbin/ypbind

/usr/share/locale/de/LC_MESSAGES/ypbind.mo

/var/yp

/var/yp/binding

[root@command init.d]#

 

ypbind RPC(Remote Procedure Call) 이용하여 NIS서버(Master, Slave) NIS클라이언트서버의 바이딩(Binding) 담당하는 NIS바이딩데몬입니다.  


, ypbind NIS Binding 프로세스로서 동일한 NIS도메인을 사용하는 NIS서버와 NIS클라이언트 사이에서 NIS데이터베이스 정보(NIS 맵정보) 사용할 있도록 연결하는 주된 데몬입니다


또한 NIS서버와 NIS클라이언트 연결을 담당하는 ypbind NIS마스터서버와 NIS슬레이브서버 그리고 NIS클라이언트에서 모두 실행되어야하는 데몬입니다.

 

데몬실행방법             : ypbind [-c][-d|-debug][-broadcast][-broken-server]
                                  [-ypset][-ypsetme][-no-ping][-f configfile]

일반적인 데몬시작방법    : /etc/rc.d/init.d/ypbind start

 

NIS클라이언트에서 ypbind 실행하면 ypbind데몬은 NIS서비스를 담당할 NIS서버를 찾기위하여 브로드케스팅(Broadcasting) 하고 서비스요청을 받은 NIS서버에서는 ypserv데몬이 응답을 합니다


만약 NIS서버에서 응답이 없을 경우에는 NIS클라이언트는 NIS서비스를 받기위하여 다시 브로드케스팅을 하게 됩니다.

 

 

NIS Master Server에서 ypbind 실행 확인

아래의 예는 NIS마스터서버에서 ypbind 실행한 예입니다


, NIS마스터서버에서 /etc/rc.d/init.d/ypbind스크립트를 이용하여 ypbind데몬을 실행하고 ps명령어로 실행확인을 예입니다.

 

[root@command yp]# /etc/rc.d/init.d/ypbind start

Binding to the NIS domain: [  OK  ]

Listening for an NIS domain server.

[root@command yp]#

[root@command init.d]# ps -ef | grep ypbind

root      2432     1  0 00:02 ?        00:00:00 ypbind

root      2769  1880  0 00:55 pts/0    00:00:00 grep ypbind

[root@command init.d]#

 

 

NIS Slave Server에서 ypbind 실행 확인

 

아래의 예는 NIS슬레이브서버에서 ypbind 실행한 예입니다


, NIS슬레이브서버에서 /etc/rc.d/init.d/ypbind스크립트를 이용하여 ypbind데몬을 실행하고 ps명령어로 실행확인을 예입니다.

 

[root@file yp]# /etc/rc.d/init.d/ypbind start

Binding to the NIS domain: [  OK  ]

Listening for an NIS domain server.

[root@file yp]#

[root@file yp]# ps -ef | grep ypbind

root     10891     1  0 00:19 ?        00:00:00 ypbind

root     10946  2320  0 00:52 pts/0    00:00:00 grep ypbind

[root@file yp]#

 

 

NIS Client에서 ypbind 실행 확인

 

그리고 다음 예는 NIS클라이언트에서 ypbind 실행한 예입니다


, NIS클라이언트에서 /etc/rc.d/init.d/ypbind스크립트를 이용하여 ypbind데몬을 실행하고 ps명령어로 실행확인을 예입니다.

 

[root@bible root]# /etc/rc.d/init.d/ypbind start

Binding to the NIS domain: [  OK  ]

Listening for an NIS domain server.

[root@bible root]#

[root@bible root]# ps -ef | grep ypbind

root      1797     1  0 16:00 ?        00:00:00 ypbind

root      1832  1743  0 16:36 pts/0    00:00:00 grep ypbind

[root@bible root]#

 

, 위의 예들과 같이 ypbind데몬은 NIS마스터서버, NIS슬레이브서버, NIS클라이언트에서 모두 실행되어야하는 데몬입니다.

 

 

NIS맵의 전송시 속도증가를 위한 ypxfrd 데몬

 

ypxfrd NIS맵파일을 전송하기위한 명령어이며 또한 NIS마스터서버에서 NIS슬레이브서버로 아주 NIS맵의 전송시 속도를 증가시킬 목적으로 사용되는 NIS서비스 관련데몬입니다


, NIS슬레이브서버가 새로운 NIS맵이 존재한다는 메시지를 받게 되었을 ypxfrd데몬은 새로운 맵을 전송하기위하여 실행됩니다


ypxfrd데몬은 yp_all()함수를 이용하여 NIS마스터서버로부터  NIS 내용을 읽어들입니다.

 

, NIS슬레이브서버에서 ypinit명령어를 실행하면 지정된 NIS마스터서버로부터 NIS데이터베이스파일들을 가져오는데 이때 전송을 담당하는 데몬이 ypxfrd입니다


이번 절의 예에서 실제로 NIS슬레이브서버에서 ypxfrd데몬을 이용하여 NIS마스터서버로부터 NIS맵을 가져오는 예를 확인하시기 바랍니다.

 

데몬실행방법 : /etc/rc.d/init.d/ypxfrd start

사용형식     : /usr/sbin/rpc.ypxfrd [ -d path ] [ -p port ] [ --debug ]

              /usr/sbin/rpc.ypxfrd -version

 

다음은 ypxfrd데몬을 실행하는 예입니다


데몬의 실제위치는 /usr/sbin/rpc.ypxfrd이지만 데몬을 실행하기 위하여 아래와 같이 /etc/rc.d/init.d/ypxfrd스크립트를 이용합니다


그리고 실행한 후에 ps명령어로 실행된 데몬을 확인 하였습니다.

 

[root@command root]# /etc/rc.d/init.d/ypxfrd start

Starting YP map server: [  OK  ]

[root@command root]#

[root@command root]# ps -ef | grep rpc.ypxfrd    

root      2169     1  0 13:36 ?        00:00:00 rpc.ypxfrd

root      2173  2036  0 13:36 pts/0    00:00:00 grep rpc.ypxfrd

[root@command root]#

 

다음 예는 NIS슬레이브서버에서 ypinit명령어를 이용하여 NIS마스터서버에서 새로운 맵을 전송하는 예이며 맵들의 전송을 담당하는 데몬이 ypxfrd임을 확인할 있습니다.

 

[root@file yp]# /usr/lib/yp/ypinit -s command.superuser.co.kr

We will need a few minutes to copy the data from command.superuser.co.kr.

Transferring mail.aliases...

Trying ypxfrd ... success

 

Transferring protocols.bynumber...

Trying ypxfrd ... success

 

Transferring services.byservicename...

Trying ypxfrd ... success

 

Transferring netid.byname...

Trying ypxfrd ... success

 

Transferring services.byname...

Trying ypxfrd ... success

 

Transferring rpc.bynumber...

Trying ypxfrd ... success

 

Transferring rpc.byname...

Trying ypxfrd ... success

 

Transferring hosts.byaddr...

Trying ypxfrd ... success

 

Transferring hosts.byname...

Trying ypxfrd ... success

 

Transferring group.bygid...

Trying ypxfrd ... success

 

Transferring group.byname...

Trying ypxfrd ... success

 

Transferring passwd.byname...

Trying ypxfrd ... success

 

Transferring protocols.byname...

Trying ypxfrd ... success

 

Transferring ypservers...

Trying ypxfrd ... success

 

Transferring passwd.byuid...

Trying ypxfrd ... success

 

file.superuser.co.kr's NIS data base has been set up.

If there were warnings, please figure out what went wrong, and fix it.

 

At this point, make sure that /etc/passwd and /etc/group have

been edited so that when the NIS is activated, the data bases you

have just created will be used, instead of the /etc ASCII files.

[root@file yp]#

 

, NIS마스터서버로부터 새로운NIS맵을 가져올 사용하는 “ypxfrd”데몬의 역할을 확인하기 위한 예입니다


그리고 위와 같이 실행이 완료되고 나면 NIS슬레이브서버의 /var/yp/superuser/ 디렉토리에는 새로가져온 NIS데이터베이스파일들이 생성(저장) 됩니다.

 

 

NIS환경에서 패스워드 변경요청을 처리하는 yppasswdd 데몬

 

yppasswdd NIS에서  패스워드 업데이트를 처리하는 NIS패스워드 데몬으로서 정확한 데몬명은 rpc.yppasswdd입니다


, NIS패스워드를 변경하는 명령어인 yppasswd의 요청에 의해 NIS패스워드를 직접 변경해주는 데몬입니다


패스워드 변경요청을 받으면 현재 사용중인 패스워드를 검증한 후에 맞다면 패스워드 변경처리를 합니다. 


 따라서 NIS마스터서버에는 yppasswd에 의해 요청되는 패스워드 처리를 위하여 rpc.yppasswdd데몬이 실행되어 있어야 합니다.

 

사용형식

rpc.yppasswdd [-D directory] [-e chsh|chfn] [--port number]

       rpc.yppasswdd [-s shadow] [-p passwd] [-e chsh|chfn] [--port number]

       rpc.yppasswdd -x program|-E program [-e chsh|chfn] [--port number]

 

NIS패스워드 데몬 rpc.yppasswdd와 관련된 파일들은 다음과 같습니다.

 

- /usr/sbin/rpc.yppasswdd

       - /usr/lib/yp/pwupdate     

       - /etc/passwd            

       - /etc/shadow            

 

NIS마스터서버에서 rpc.yppasswdd데몬을 실행하려면 /etc/rc.d/init.d/yppasswdd 스크립트를 이용합니다.  아래의 예는 NIS마스터서버에는 rpc.yppasswdd 데몬의 실행과 실행확인을 하는 예입니다.

 

[root@command init.d]# /etc/rc.d/init.d/yppasswdd start

Starting YP passwd service: [  OK  ]

[root@command init.d]#

[root@command init.d]# ps -ef | grep yppasswdd

root      2638     1  0 00:10 ?        00:00:00 rpc.yppasswdd

root      2858  1880  0 01:10 pts/0    00:00:00 grep yppasswdd

[root@command init.d]#

 

위와 같이 rpc.yppasswdd데몬이 실행되어 있다면 NIS클라이언트에서 yppasswd명령어를 이용하여 NIS사용자의 패스워드를 변경할 있습니다.

 

 

 

7. NIS명령어 실무다루기

 

NIS 맵정보를 확인하는 ypcat

 

ypcat NIS맵정보를 확인하는 명령어입니다


, NIS 맵이름이나 맵의 별칭을 지정하여 해당 맵에 대한 NIS데이터베이스내의 정보를 확인하는 명령어입니다.

 

사용형식  ypcat [-kt][-d NIS도메인] [-h 호스트명] 맵이름

         ypcat -x

 

위의 사용형식에서 사용되는 옵션들에 대한 설명입니다.  ypcat 있어서 매우 중요한 옵션들입니다.

 

-d NIS도메인

만약 옵션으로 NIS도메인을 지정한다면 기본NIS도메인이 아닌 경우에 사용하도록 하십시요


기본 NIS도메인을 대상으로 맵정보를 확인하실 때에는 옵션을 사용하지 않으셔도 됩니다


, ypcat명령어는 옵션이 주어지지 않는다면 기본NIS도메인을 대상으로 합니다. 참고로 NIS도메인을 확인하실 때에는 nisdomainname 또는 domainname으로 확인 하실 있습니다.

 

-h 호스트명

기본 호스트명이 아닌 경우에 옵션을 사용하여 호스트명을 지정할 있습니다.

 

-x

NIS데이터베이스 맵정보의 별칭테이블을 확인할 있습니다.

 

다음의 예는 ypcat명령어로 NIS데이터베이스내의 group.byname이라는 맵정보를 확인한 것입니다.



[root@bible root]# ypcat group.byname

command:!:500:

sspark:!:501:

[root@bible root]#

 

참고로 group.byname이라는 맵의 별칭이 group이므로 다음과 같이 사용하셔도 동일한 결과를 얻을 있습니다.


 

[root@bible root]# ypcat group

command:!:500:

sspark:!:501:

[root@bible root]#

 

, ypcat명령어는 맵이름과 맵이름의 별칭으로도 확인이 가능합니다.

 

다음의 예는 ypcat명령어로 NIS데이터베이스내의 hosts.byname이라는 맵정보를 확인한 것입니다.

 

[root@bible root]# ypcat hosts.byname

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

192.168.0.100   file.superuser.co.kr    file

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

192.168.0.110   bible.superuser.co.kr   bible

192.168.0.100   file.superuser.co.kr    file

192.168.0.110   bible.superuser.co.kr   bible

[root@bible root]#

 

참고로 hosts.byname이라는 맵의 별칭이 hosts이므로 다음과 같이 사용하셔도 동일한 결과를 얻을 있습니다.

 

[root@bible root]# ypcat hosts

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

192.168.0.100   file.superuser.co.kr    file

127.0.0.1       command.superuser.co.kr command localhost.localdomain localhost

192.168.0.110   bible.superuser.co.kr   bible

192.168.0.100   file.superuser.co.kr    file

192.168.0.110   bible.superuser.co.kr   bible

[root@bible root]#

 

, ypcat명령어는 맵이름과 맵이름의 별칭으로도 확인이 가능합니다.

 

다음의 예는 ypcat명령어로 NIS데이터베이스내의 passwd.byname라는 맵정보를 확인한 것입니다.


[root@bible root]# ypcat passwd.byname

command:$1$9qxX$$$$$$70LtdBp$$ug9dcCBDTiq.:500:500::/home/command:/bin/bash

sspark:$1$PkkkA$dd$$$tdddddddonE8w1bCWpj4f/:501:501::/home/sspark:/bin/bash

[root@bible root]#

 

참고로 passwd.byname이라는 맵의 별칭이 passwd이므로 다음과 같이 사용하셔도 동일한 결과를 얻을 있습니다.

 

[root@bible root]# ypcat passwd

command:$1$9qxX$$$$$$70LtdBp$$ug9dcCBDTiq.:500:500::/home/command:/bin/bash

sspark:$1$PkkkA$dd$$$tdddddddonE8w1bCWpj4f/:501:501::/home/sspark:/bin/bash

[root@bible root]#

 

, ypcat명령어는 맵이름과 맵이름의 별칭으로도 확인이 가능합니다.

 

이번에는 NIS맵들의 별칭을 확인하는 방법입니다


, ypcat명령어에 -x옵션을 사용하시면 확인가능한 모든 NIS맵들에 대한 별칭을 확인할 있습니다.  


아래의 예는 NIS맵들에 대한 별칭을 확인한 예입니다.

 

[root@bible root]# 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"

[root@bible root]#

 

위의 결과로 ethers.byname맵의 별칭이 ethers라는 것을 있고

mail.aliases맵의 별칭이 aliases라는 것을 있고

services.byname맵의 별칭이 services라는 것을 각각 있습니다.

 

이하 맵들의 별칭도 확인하시기 바랍니다.

 

위의 맵들에 대한 별칭을 확인하였다면 맵이름 대신 맵의 별칭사용이 가능합니다


그리고 “ypcat -x”명령어의 결과는 “ypmatcht -x” 그리고 “ypwhich -x” 결과와 같다는 것을 있습니다.

 

 

NIS환경의 사용자 패스워드 변경하는 yppasswd

 

yppasswd NIS환경에서 NIS사용자의 패스워드를 변경하는 명령어입니다


, NIS클라이언트에서 yppasswd명령어로 특정 NIS사용자의 패스워드 변경을 요청하면 NIS마스터서버의 rpc.yppasswdd데몬이 요청을 받아서 처리해 줍니다.

 

사용형식   : yppasswd [-f][-l][-p][NIS사용자계정]

 

다음은 NIS클라이언트에서 sspark이라는 사용자가 자기자신의 NIS패스워드를 변경하는 예입니다


, 자기자신의 패스워드를 변경할 때에는 “yppasswd”명령어만 실행하면 됩니다


그리고 현재 사용중인 패스워드와 새로운 패스워드를 두번 연속해서 입력하시면 변경이 됩니다.

 

 [sspark@bible sspark]$ id

uid=502(sspark) gid=502(sspark) groups=502(sspark)

[sspark@bible sspark]$

[sspark@bible sspark]$ yppasswd

Changing NIS account information for sspark on command.superuser.co.kr.

Please enter old password:********

Changing NIS password for sspark on command.superuser.co.kr.

Please enter new password:********

Please retype new password:********

 

The NIS password has been changed on command.superuser.co.kr.

 

[sspark@bible sspark]$

 

다음은 NIS클라이언트에서 root계정으로 sspark사용자의 NIS패스워드를 변경하는 예입니다


, root계정으로 특정 계정의 NIS패스워드를 변경할 때에는 “yppasswd  NIS계정명 같이 사용하시면 됩니다


이때 “Please enter root password:”에는 root사용자의 패스워드를 입력하셔야하고 다음 sspark사용자가 사용할 새로운 패스워드를 두번 연속해서 입력해 주시면 됩니다


아래는 예입니다.

 

[root@bible root]# id

uid=0(root)gid=0(root)groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

[root@bible root]#

[root@bible root]# yppasswd command

Changing NIS account information for command on command.superuser.co.kr.

Please enter root password: ********

Changing NIS password for command on command.superuser.co.kr.

Please enter new password: ********

Please retype new password: ********

 

The NIS password has been changed on command.superuser.co.kr.

 

[root@bible root]#

 

앞부분에서 말씀드렸듯이 NIS클라이언트에서 yppasswd명령어로 사용자의 NIS패스워드를 변경하려면 NIS마스터서버에 rpc.yppasswdd데몬이 실행되어있어야 합니다.

 

 

NIS클라이언트에서 NIS서버를 확인하는 ypwhich

 

ypwhich 주로 NIS클라이언트에서 사용하는 명령어로서 NIS클라이언트에게 서비스를 담당하고 있는 NIS서버를 확인하기위하여 사용하는 NIS명령어입니다


어떤 NIS서버가 현재 NIS클라이언트에게 서비스를 주는가를 확인하거나 맵이름이 주어졌을 경우에는 해당 맵의 NIS마스터서버를 확인하기 위하여 사용하는 명령어입니다.

 

다음은 ypwhich명령어를 이용하여 현재 NIS클라이언트에게 서비스하는 NIS서버를 확인한 예입니다


아래 결과로 보아 현재 NIS클라이언트는 command.superuser.co.kr이라는 NIS서버가 서비스를 담당하고 있다는 것을 있습니다. 

 

[root@bible root]# ypwhich

command.superuser.co.kr

[root@bible root]#

 

다음은 ypwhich명령어의 -m옵션을 사용하여 조회가능한 모든 맵의 NIS마스터서버가 어떤것인가를 확인하는 예입니다.

 

[root@bible root]# ypwhich -m

mail.aliases command.superuser.co.kr

protocols.bynumber command.superuser.co.kr

services.byservicename command.superuser.co.kr

netid.byname command.superuser.co.kr

services.byname command.superuser.co.kr

rpc.bynumber command.superuser.co.kr

rpc.byname command.superuser.co.kr

hosts.byaddr command.superuser.co.kr

hosts.byname command.superuser.co.kr

group.bygid command.superuser.co.kr

group.byname command.superuser.co.kr

passwd.byname command.superuser.co.kr

protocols.byname command.superuser.co.kr

ypservers command.superuser.co.kr

passwd.byuid command.superuser.co.kr

[root@bible root]#

 

다음은 ypwhich명령어의 -m옵션을 사용하여 hosts passwd라는 두개의 맵에 대한  NIS마스터서버가 어떤것인가를 확인한 예입니다


아래 결과 hosts passwd 두개의 모두  서비스를 담당하고있는 NIS마스터서버는 command.superuser.co.kr임을 수가 있습니다.

 

[root@bible root]# ypwhich -m hosts

command.superuser.co.kr

[root@bible root]#

[root@bible root]# ypwhich -m passwd

command.superuser.co.kr

[root@bible root]#

 

다음은 지정한 NIS클라이언트의 서비스를 담당하고 있는 NIS서버가 어떤 것인가를 확인하는 예입니다


, “ypwhich NIS클라이언트호스트명 같은 형식으로 지정한 NIS클라이언트의 NIS서비스를 담당하고있는 NIS서버를 확인할 있습니다


아래의 결과로 보아 bible.superuser.co.kr이라는 NIS클라이언트에게 서비스하고 있는 NIS마스터서버는 command.superuser.co.kr임을 수가 있습니다.

 

[root@bible root]# ypwhich bible.superuser.co.kr

command.superuser.co.kr

[root@bible root]#

 

다음은 NIS 맵에 대한 알리아스(별칭)테이블을 확인하는 예입니다


, ypwhich명령어에 -x옵션을 사용하시면 현재 확인가능한 모든 맵들에 대한 별칭테이블을 다음 예와 같이 보여줍니다.

 

[root@bible root]# 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@bible root]#

 

그리고 “ypwhich -x”명령어의 결과는 “ypcat -x” 결과, 그리고 “ypmatch -x” 결과와 같다는 것을 있습니다.

 

 

NIS맵으로부터 하나이상의 키값을 출력하는 ypmatch

 

ypmatch NIS맵으로부터 하나이상의 키값을 출력하는 명령어입니다


, ypmatch명령어에 맵이름이나 맵의 별칭을 지정하시면 지정한 맵의 키값을 확인할 있습니다.

 

ypmatch에서는 다음 옵션을 알고 계셔야합니다.

-d NIS도메인  : 검색하고자하는 대상 NIS도메인명을 지정하시면 됩니다.

 

다음은 NIS클라이언트에서 ypmatch명령어를 이용하여 특정맵의 키값을 확인하는 예입니다


, passwd.byname맵의 sspark이라는 키값의 정보를 확인한 예입니다.

 

[sspark@bible sspark]$ ypmatch sspark passwd.byname

sspark:$1$3Xg2ldldldlifeKJjOxjXMiBHmMsWm1:502:502::/home/sspark:/bin/bash

[sspark@bible sspark]$

 

위의 명령어는 passwd.byname맵의 별칭인 passwd 이용하여 다음과 같이 사용할 수도 있습니다.

 

[sspark@bible sspark]$ ypmatch sspark passwd

sspark:$1$3Xg2ldldldlifeKJjOxjXMiBHmMsWm1:502:502::/home/sspark:/bin/bash

[sspark@bible sspark]$

 

그리고 다음은 hosts.byname맵의 bible.superuser.co.kr키값의 정보를 확인한 예입니다.

 

[sspark@bible sspark]$ ypmatch bible.superuser.co.kr hosts.byname

192.168.0.110   bible.superuser.co.kr   bible

[sspark@bible sspark]$

 

그리고 위의 명령어는 hosts.byname맵의 별칭인 hosts 이용하여 다음과 같이 사용할 수도 있습니다.

 

[sspark@bible sspark]$ ypmatch bible.superuser.co.kr hosts

192.168.0.110   bible.superuser.co.kr   bible

[sspark@bible sspark]$

 

그리고 다음은 ypmatch명령어에서 -x옵션을 사용하여 NIS맵의 별칭테이블을 확인한 것입니다. , -x 옵션은 맵의 별칭테이블을 확인하고자 사용하는 옵션입니다.

 

[sspark@bible sspark]$ ypmatch -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"

[sspark@bible sspark]$

 

위의 결과에서 맵들의 별칭을 확인하신 후에 맵이름 대신 맵의 별칭을 사용할 수도 있다는 것을 있습니다


예를 들어 ethers.bybame맵이름 대신 맵의 별칭 ethers 사용할 있다는 의미입니다. 앞의 예에서 이를 확인할 있었습니다.

 

 

그리고 “ypmatch -x”명령어의 결과는 “ypcat -x” 결과, 그리고 “ypwhich -x” 결과와 같다는 것을 있습니다.

 

 

NIS데이터베이스를 생성하는 ypinit

 

ypinit NIS서버(NIS마스터서버와 NIS슬레이브서버)에서 실행하는 명령어로서 NIS데이터베이스를 생성(NIS) 설정합니다


그리고 ypinit명령어는 root권한으로만 실행이 가능하며 하나의 NIS도메인에는 하나의 마스터서버만이 존재할 있습니다


NIS마스터서버에서 ypinit명령어를 실행하면 “/var/yp/Makefile”파일의 내용에 따라서 NIS데이터베이스를 생성하고 NIS맵을 설정합니다


그리고 NIS슬레이브서버에서 ypinit 실행하면 NIS마스터서버에 있는 NIS 데이터베이스파일들을 복사해 옵니다


NIS서버에서 NIS데이터베이스를 생성하고 설치하므로 NIS클라이언트에서는 실행할 없습니다.

 

사용형식  마스터서버   : /usr/lib/yp/ypinit [-m]

슬레이브서버 : /usr/lib/yp/ypinit [-s 마스터서버]

       

위의 사용형식에서 NIS마스터서버에서는 -m옵션을 사용하고 NIS슬레이브서버에서는 -s옵션을 사용합니다.

 

위에서 말씀드린바와 같이 ypinit 결과로 NIS서버에는 “/var/yp/” 라는 디렉토리내에 해당 NIS도메인 디렉토리가 생성되고 여기에 해당 NIS도메인 데이터베이스파일들이 저장됩니다. 다음은 ypinit 실행한 후에 superuser라는 NIS도메인 이름으로 생성된 디렉토리의 내용을 살펴본 것입니다.

 

[root@command yp]# ls -l /var/yp/superuser

total 328

-rw-------    1 root     root        12450 Feb 27 11:23 group.bygid

-rw-------    1 root     root        12458 Feb 27 11:23 group.byname

-rw-------    1 root     root        12607 Feb 27 11:23 hosts.byaddr

-rw-------    1 root     root        12984 Feb 27 11:23 hosts.byname

-rw-------    1 root     root        13110 Feb 27 11:23 mail.aliases

-rw-------    1 root     root        13713 Feb 27 11:23 netid.byname

-rw-------    1 root     root        12581 Feb 27 11:23 passwd.byname

-rw-------    1 root     root        12573 Feb 27 11:23 passwd.byuid

-rw-------    1 root     root        29201 Feb 27 11:23 protocols.byname

-rw-------    1 root     root        14518 Feb 27 11:23 protocols.bynumber

-rw-------    1 root     root        16431 Feb 27 11:23 rpc.byname

-rw-------    1 root     root        14249 Feb 27 11:23 rpc.bynumber

-rw-------    1 root     root        49152 Feb 27 11:23 services.byname

-rw-------    1 root     root        53248 Feb 27 11:23 services.byservicename

-rw-------    1 root     root        12437 Feb 27 11:23 ypservers

[root@command yp]#

 

그리고 다음은 ypinit명령어로 NIS도메인 데이터베이스를 생성할 때에 참조되는 시스템 파일들입니다.

 

/etc/passwd     : 사용자계정 정보 파일

/etc/group      : 사용자 그룹 정보 파일

/etc/hosts      : 호스트정보 파일

/etc/networks   : 네트워크이름 정보파일

/etc/services   : 인터넷서비스와 사용하는 포트에 관한 정보 파일

/etc/protocols  : 인터넷 프로토콜 정보파일

/etc/netgroup   : 네트워크의 사용자그룹 정보 파일

/etc/rpc        : 정보파일

 

, 그럼 이제부터 ypinit명령어를 이용하여 NIS마스터서버와 NIS슬레이브서버에서 NIS데이터베이스를 각각 생성해보도록 하겠습니다


다음 절의 설명을 보시기 바랍니다.

 

 

NIS 마스터서버에서 ypinit으로 NIS서버 구성하기

 

다음은 NIS마스터서버에서 ypinit명령어를 사용하여 NIS데이터베이스를 생성하고 NIS맵을 설정하는 실제 예입니다


앞서 설명드린바와 같이 NIS마스터서버에서는 ypinit명령어에 -m옵션을 사용하셔야 합니다.

 

[root@command yp]# /usr/lib/yp/ypinit -m

 

At this point, we have to construct a list of the hosts which will run NIS

servers.  command.superuser.co.kr 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:  command.superuser.co.kr

        next host to add:  bible.superuser.co.kr

        next host to add:  file.superuser.co.kr

        next host to add:  ^D

The current list of NIS servers looks like this:

 

command.superuser.co.kr

bible.superuser.co.kr

file.superuser.co.kr

 

Is this correct?  [y/n: y]  y

We need a few minutes to build the databases...

Building /var/yp/superuser/ypservers...

Running /var/yp/Makefile...

gmake[1]: Entering directory `/var/yp/superuser'

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/superuser'

 

command.superuser.co.kr has been set up as a NIS master server.

 

Now you can run ypinit -s command.superuser.co.kr on all slave server.

[root@command yp]#

 

위와 같이 “/usr/lib/yp/ypinit -m” 실행하시면 “next host to add:” 나타나고 같은 NIS도메인을 사용하는 다른 호스트를 입력하시면 됩니다


입력이 마무리가 되고나면 “^D” 입력하십시요


그런 다음 “Is this correct?  [y/n: y]”에는 “y” 입력하시면 됩니다


여기까지 마치고 나면 NIS도메인명의 “/var/yp/NIS도메인으로 디렉토리를 생성하고 “/var/yp/Makefile” 참조하여 NIS데이터베이스파일들을 “/var/yp/NIS도메인 생성합니다.

 

이번 예에서 NIS도메인명이 “superuser”이므로 /var/yp/superuser라는 디렉토리를 생성하고 안에 NIS데이터베이스파일들을 생성하고 맵을 설정하였습니다.

 

NIS 슬레이브서버에서 ypinit으로 NIS서버 구성하기

 

그리고 이번에는 NIS슬레이브서버에서 ypinit명령어를 이용하여 NIS슬레이브서버를 설정하는 예를 보겠습니다


앞의 예에서 보았듯이 NIS마스터서버에서 ypinit 실행하면 NIS데이터베이스파일들을 직접 생성하지만 NIS슬레이브서버에서 ypinit 실행하면 지정된 NIS마스터서버로부터 NIS데이터베이스파일들을 가져옵니다.  


이때 전송을 담당하는 데몬은 ypxfrd데몬입니다.

 

아래의 예는 NIS슬레이브서버인 file.superuser.co.kr에서 ypinit명령어를 이용하여  NIS슬레이브서버를 구성한 예입니다


, 말씀드린바와 같이 대상이 되는 NIS마스터서버는 command.superuser.co.kr이므로 아래와 같이 -s옵션 다음에 command.superuser.co.kr 지정한 것입니다.

 

[root@file yp]# /usr/lib/yp/ypinit -s command.superuser.co.kr

We will need a few minutes to copy the data from command.superuser.co.kr.

Transferring mail.aliases...

Trying ypxfrd ... success

 

Transferring protocols.bynumber...

Trying ypxfrd ... success

 

Transferring services.byservicename...

Trying ypxfrd ... success

 

Transferring netid.byname...

Trying ypxfrd ... success

 

Transferring services.byname...

Trying ypxfrd ... success

 

Transferring rpc.bynumber...

Trying ypxfrd ... success

 

Transferring rpc.byname...

Trying ypxfrd ... success

 

Transferring hosts.byaddr...

Trying ypxfrd ... success

 

Transferring hosts.byname...

Trying ypxfrd ... success

 

Transferring group.bygid...

Trying ypxfrd ... success

 

Transferring group.byname...

Trying ypxfrd ... success

 

Transferring passwd.byname...

Trying ypxfrd ... success

 

Transferring protocols.byname...

Trying ypxfrd ... success

 

Transferring ypservers...

Trying ypxfrd ... success

 

Transferring passwd.byuid...

Trying ypxfrd ... success

 

 

file.superuser.co.kr's NIS data base has been set up.

If there were warnings, please figure out what went wrong, and fix it.

 

At this point, make sure that /etc/passwd and /etc/group have

been edited so that when the NIS is activated, the data bases you

have just created will be used, instead of the /etc ASCII files.

[root@file yp]#

 

NIS마스터서버로부터 NIS데이터베이스파일을 가져올 전송을 담당하는 데몬은 “ypxfrd”데몬입니다


위와 같이 실행이 완료되고 나면 /var/yp/superuser/ 디렉토리에 다음과 같은 NIS데이터베이스파일들이 생성이 됩니다.

 

[root@file superuser]# ls -l /var/yp/superuser

total 332

-rw-------    1 root     root        12450  2 27 11:19 group.bygid

-rw-------    1 root     root        12458  2 27 11:19 group.byname

-rw-------    1 root     root        12607  2 27 11:19 hosts.byaddr

-rw-------    1 root     root        12984  2 27 11:19 hosts.byname

-rw-------    1 root     root        13110  2 27 11:19 mail.aliases

-rw-------    1 root     root        13713  2 27 11:19 netid.byname

-rw-------    1 root     root        12581  2 27 11:19 passwd.byname

-rw-------    1 root     root        12573  2 27 11:19 passwd.byuid

-rw-------    1 root     root        29201  2 27 11:19 protocols.byname

-rw-------    1 root     root        14518  2 27 11:19 protocols.bynumber

-rw-------    1 root     root        16431  2 27 11:19 rpc.byname

-rw-------    1 root     root        14249  2 27 11:19 rpc.bynumber

-rw-------    1 root     root        49152  2 27 11:19 services.byname

-rw-------    1 root     root        53248  2 27 11:19 services.byservicename

-rw-------    1 root     root        12437  2 27 11:19 ypservers

[root@file superuser]#

 

이번 예에서는 NIS도메인명이 superuser이므로 /var/yp/superuser/ 디렉토리에 NIS데이터베이스파일들이 생성된 것입니다.

 

 

NIS환경에서의 사용자정보 설정 변경하는 ypchfn

 

NIS에서 지정한 사용자의 정보를 설정하거나 변경하는 명령어입니다


, NIS사용자의 이름과 주소,전화번호등의 정보를 설정 변경할 있는 명령어입니다


물론 명령어가 정상적으로 실행이 되려면 NIS마스트서버, NIS슬레이브서버, 그리고 NIS클라이언트의 환경이 정상적으로 구성되어 있어야만 가능합니다.

 

사용형식   : ypchfn [user]

 

다음 예는 NIS클라이언트에서 sspark이라는 NIS사용자 계정으로 자기자신(sspark) 개인정보를 변경하는 예입니다.

 

[sspark@command sspark]$ ypchfn

Changing NIS account information for sspark on command.superuser.co.kr.

Please enter password: ********

 

Changing full name for sspark on command.superuser.co.kr.

To accept the default, simply press return. To enter an empty

field, type the word "none".

Name []:Parksungsoo

Location []:SUPERUSER LAB

Office Phone []:02-222-3333

Home Phone []:02-222-5555

 

The GECOS information has been changed on command.superuser.co.kr.

 

[sspark@command sspark]$

 

위와 같이 “ypchfn” 실행한 후에 sspark사용자의 NIS패스워드를 입력하시고 다음에 나오는 “Name, Location, Office Phone, Home Phone”항목에 각각 원하는 정보를 입력하시면 됩니다. 위의 결과로 변경된 sspark사용자의 계정정보는 다음과 같습니다.

 

- 이름(Name)                   : Parksungsoo

- 근무지(Location)             : SUPERUSER LAB

- 사무실전화번호(Office Phone) : 02-222-3333

- 집전화번호(Home Phone)       : 02-222-5555

 

만약 root계정으로 sspark사용자의 계정정보를 변경하고자 한다면 다음예와 같이 “ypchfn 계정명으로 하셔야합니다


그리고 이때에는 sspark 사용자패스워드가 아닌 root패스워드를 입력하셔야 합니다.

 

[root@bible root]# ypchfn sspark

Changing NIS account information for sspark on command.superuser.co.kr.

Please enter root password:********

 

Changing full name for sspark on command.superuser.co.kr.

To accept the default, simply press return. To enter an empty

field, type the word "none".

Name []:Parksungsoo

Location []:SUPERUSER LAB

Office Phone []:02-222-3333

Home Phone []:02-222-5555

 

The GECOS information has been changed on command.superuser.co.kr.

 

[root@bible root]#

 

위의 결과로 변경된 sspark사용자의 계정정보는 다음과 같습니다.

 

- 이름(Name)                   : Parksungsoo

- 근무지(Location)             : SUPERUSER LAB

- 사무실전화번호(Office Phone) : 02-222-3333

- 집전화번호(Home Phone)       : 02-222-5555

 

 

 

NIS환경에서의 사용자 로그인쉘 변경하는 ypchsh

 

ypchsh NIS에서 지정한 사용자의 로그인 (login shell) 변경하는 명령어입니다


명령어가 정상적으로 실행이 되려면 NIS마스트서버, NIS슬레이브서버, 그리고 NIS클라이언트의 환경이 정상적으로 구성되어 있어야만 가능합니다.  


명령어를 실행하면 “Login shell [/bin/sh]:” 같은 프롬프트가 출력됩니다. 여기에서 변경하고자하는 로그인쉘을 입력하시면 됩니다.

 

사용형식   : ypchsh [user]

 

다음 예는 NIS클라이언트에서 sspark이라는 계정으로 자기자신(sspark) 로그인쉘을 변경한 예입니다.

 

[sspark@command sspark]$ ypchsh

Changing NIS account information for sspark on command.superuser.co.kr.

Please enter password:*******

 

Changing login shell for sspark on command.superuser.co.kr.

To accept the default, simply press return. To use the

system's default shell, type the word "none".

Login shell [/bin/bash]: /bin/csh

 

The login shell has been changed on command.superuser.co.kr.

 

[sspark@command sspark]$

 

위의 예에서 ypchsh 실행한 후에는 sspark 패스워드를 입력하셔야합니다


그리고 위의 실행결과 sspark 기존 로그인쉘(/bin/bash) /bin/csh 변경되었습니다.

 

만약 root계정으로 sspark 로그인쉘을 변경하고자 한다면 “ypchsh sspark” 같이 사용하셔야 합니다


그리고 입력하시는 패스워드 또한 root 패스워드를 입력하셔야 변경이 가능합니다


아래는 root계정으로 sspark사용자의 로그인쉘을 변경한 예입니다.

 

[root@bible root]# ypchsh sspark

Changing NIS account information for sspark on command.superuser.co.kr.

Please enter root password:********

 

Changing login shell for sspark on command.superuser.co.kr.

To accept the default, simply press return. To use the

system's default shell, type the word "none".

Login shell [/bin/bash]: /bin/csh

 

The login shell has been changed on command.superuser.co.kr.

 

[root@bible root]#

 

, 위의 예는 root사용자가 sspark사용자의 로그인쉘을 /bin/csh 변경한 예입니다.

 

 

ypserv데몬에서 사용하는 NISID번호 확인하는 yppoll

 

yppoll NIS서비스에서 마스터서버의 확인과 확인한 마스터서버의 ypserv데몬에서 사용하는 특정 NIS ID번호(order number) 확인하는 명령어입니다.


 NIS맵의 ID ypbind 요청에 의해 갱신될 있기 때문에 변경될 있는 값입니다


따라서 마스터서버에서 최근버전의 ID 사용하고 있는가를 확인하기 위하여 yppoll명령어를 사용하기도 합니다.

 

명령어를 사용할 주의하실 것은 yppoll명령어에서는 별칭을 인식하지 못하므로 완전한 맵이름을 사용해야 한다는 것입니다.  


, ypcat이나 ypmatch명령어에서는 맵의 별칭사용이 가능하였으나 yppoll에서는 맵별칭을 사용할 없습니다.

 

사용형식   : yppoll [-h 호스트] [-d NIS도메인] 맵이름

 

위의 형식에서 “-h 호스트 지정한 호스트에 실행되어 있는 NIS서버의 ypserv데몬에게  ID확인을 요청합니다.  


또한 “-d NIS도메인 기본NIS도메인이 아닌 다른 NIS도메인을 지정할 사용합니다.

 

다음은 yppoll명령어를 사용하여 hosts.byname이라는 맵의 최근 ID 서비스를 담당하는 마스터서버를 확인한 것입니다


아래의 결과를 보시면 hosts.byname 최근 ID “1077868990”이며 서비스를 담당하는 마스터서버는 “command.superuser.co.kr”이라는 것을 있습니다.


 

[root@command yp]# yppoll hosts.byname

Domain superuser is supported.

Map hosts.byname has order number 1077868990. [Fri Feb 27 17:03:10 2004]

The master server is command.superuser.co.kr.

[root@command yp]#

 

다음은 yppoll명령어를 사용하여 group.byname이라는 맵의 최근 ID 서비스를 담당하는 마스터서버를 확인한 것입니다


아래의 결과를 보시면 group.byname 최근 ID “1077868990”이며 서비스를 담당하는 마스터서버는 “command.superuser.co.kr”이라는 것을 있습니다.

 

[root@command yp]# yppoll group.byname

Domain superuser is supported.

Map group.byname has order number 1077868990. [Fri Feb 27 17:03:10 2004]

The master server is command.superuser.co.kr.

[root@command yp]#

 

다음은 yppoll명령어로 command.superuser.co.kr ypserv데몬에게 hosts.byname이라는 맵의 최근 ID 서비스를 하는 담당 마스터서버의 확인을 요청한 것입니다.

 

결과를 보시면 command.superuser.co.kr ypserv데몬에서 응답한 hosts.byname 최근 ID “1077868990”이라는 것을 있습니다.

 

[root@file superuser]# yppoll -h command.superuser.co.kr hosts.byname

Domain superuser is supported.

Map hosts.byname has order number 1077868990. [Fri Feb 27 17:03:10 2004]

The master server is command.superuser.co.kr.

[root@file superuser]#

 

다음은 yppoll명령어로 command.superuser.co.kr ypserv데몬에게 superuser라는 NIS도메인에서 hosts.byname이라는 맵의 최근 ID 서비스를 담당하는 마스터서버의 확인을 요청한 것입니다.

 

결과를 보시면 command.superuser.co.kr ypserv데몬에서  superuser라는 NIS도메인의 hosts.byname 최근 ID “1077868990”이라는 것을 있습니다.

 

[root@file superuser]# yppoll -h command.superuser.co.kr -d superuser hosts.byname

Domain superuser is supported.

Map hosts.byname has order number 1077868990. [Fri Feb 27 17:03:10 2004]

The master server is command.superuser.co.kr.

[root@file superuser]#

 

그리고 앞서 말씀드린바와 같이 yppoll명령어에서는 별칭사용을 없다고 하였습니다


아래는 예로서 hosts.byname맵의 별칭인 hosts 사용하였으나 hosts라는 맵을 인식하지 못한다는 예입니다.

 

[root@command yp]# yppoll hosts

Can't get any map parameter information.

Can't get order number for map hosts.

        Reason: Request arguments bad

Can't get master for map hosts.

        Reason: Request arguments bad

[root@command yp]#

 

 

 

NIS데이터베이스를 NIS마스터서버에서 NIS슬레이브서버로 복사하는 yppush

 

yppush 지정한 맵에 대한 변경된 NIS데이터베이스 정보를 NIS도메인내에 있는 NIS마스터서버에서 NIS슬레이브서버로  복사하는 명령어입니다


, yppush명령어는 NIS마스터서버에서 실행하는 명령어로서 NIS마스터서버에서 변경된 맵정보를 NIS슬레이브서버로 복사하여 NIS슬레이브서버의 맵정보를 최근정보로 갱신하는 명령어입니다.


  명령어에 의해 NIS마스터서버와 NIS슬레이브서버간의 새로운 맵정보 전송은 ypxfrd데몬이 담당하게 됩니다.

 

사용형식 : yppush [-d NIS도메인] [-t timeout] [-p # parallel jobs ] [-h 호스트] [-v]

                   맵이름...

 

위의 예에서 “-d NIS도메인 기본 NIS도메인이 아닌 다른 NIS도메인을 지정할 사용합니다.  

 

다음은 NIS마스터서버에서 yppush 이용하여 passwd.byname맵의 변경된 정보를 등록된 NIS슬레이브서버로 복사하는 예입니다


실제로 복사되는 파일의 전송은 ypxfrd데몬이 담당하게 됩니다.


 NIS슬레이브서버로 정상적으로 복사 되었다면 아래와 같이 아무런 메시지없이 종료됩니다.

 

[root@command yp]# yppush passwd.byname                       

[root@command yp]#

 

만약 NIS슬레이브서버로 복사되는 과정을 확인하고자 한다면 -v옵션을 사용하시기 바랍니다


, 아래의 예는 NIS마스터서버에서 yppush명령어를 이용하여 passwd.byname맵의 변경된 정보를 NIS슬레이브서버인 file.superuser.co.kr 복사하는 예입니다.

 

[root@command yp]# yppush -v passwd.byname

file.superuser.co.kr has been called.

Status received from ypxfr on file.superuser.co.kr:

        Transfer done: Success

[root@command yp]#

 

만약 NIS마스터서버에 지정한 맵에 대한 변경된 정보가 없을 경우에는 아래와 같이 해당 맵에 대해 마스터서버에는 새로운 변경된 정보를 가지고있지않다라는 “Master's version not newer” 같은 메시지를 출력합니다. 아래는 예입니다.

 

[root@command yp]# yppush hosts.byname                       

file.superuser.co.kr: Master's version not newer

[root@command yp]#

[root@command yp]# yppush -h file.superuser.co.kr hosts.byname

file.superuser.co.kr: Master's version not newer

[root@command yp]#

 

그리고 다음은 NIS마스터서버에서 passwd.byname맵의 변경된 정보를 file.superuser.co.kr이라는 NIS슬레이브서버로 복사하는 예입니다.

 

[root@command yp]# yppush -h file.superuser.co.kr passwd.byname  

[root@command yp]#

 

그리고 보다 자세한 복사과정을 확인하시려면 -v옵션을 사용하시기 바랍니다


아래는  NIS마스터서버에서 passwd.byname맵의 변경된 정보를 file.superuser.co.kr이라는 NIS슬레이브서버로 복사하면서 -v옵션을 사용하여 복사과정을 확인한 것입니다.

 

[root@command yp]# yppush -v -h file.superuser.co.kr passwd.byname

file.superuser.co.kr has been called.

Status received from ypxfr on file.superuser.co.kr:

        Transfer done: Success

[root@command yp]#

 

 

 

NIS서버에서 ypbind데몬을 바인딩하는 ypset

 

ypset 지정한 NIS서버에 ypbind데몬을 바인딩하는 NIS명령어입니다. ypset명령어를 실행하려면 ypbind데몬이 -ypset또는 -ypsetme옵션으로 초기화되어 있어야 합니다


, ypset명령어는 지정한 NIS도메인에 대하여 NIS서버에 실행되어 있는 ypserv데몬으로부터 NIS서비스를 가져올 있도록 ypbind데몬에게 요청합니다.

 

사용형식   : ypset [-d NIS도메인] [-h 호스트명] NIS서버

 

위의 사용형식에서 “-d NIS도메인  지정한 NIS도메인에 대한 NIS서버를 지정할 사용합니다.


  옵션을 생략하면 기본 NIS도메인을 사용합니다.

그리고 “-h 호스트명 지정한 NIS서버의 ypserv로부터 NIS서비스를 가져오는 ypbind 실행되어 있는 호스트를 지정합니다


옵션을 생략하면 ypset명령어를 실행하는 현재 로컬호스트를 의미합니다.

 

아래의 예는 NIS서버(command.superuser.co.kr) 실행되어 있는 ypserv데몬으로부터 NIS서비스를 가져오도록 ypbind데몬에게 요청한 것입니다.

 

[root@file superuser]# ypset command.superuser.co.kr

[root@file superuser]#

 

아래의 예는 superuser라는 NIS도메인에 존재하는 NIS 서버(command.superuser.co.kr) 실행되어 있는 ypserv데몬으로부터 NIS서비스를 가져오도록 command라는 호스트의 ypbind데몬에게 요청한 것입니다.

 

[root@file superuser]# ypset -d superuser -h command command.superuser.co.kr

[root@file superuser]#

 

 

 

NIS환경에서 NIS도메인네임 확인하는 ypdomainname

 

ypdomainnameNIS/YP에서 사용되는 NIS도메인네임을 출력하거나 설정하는 명령어입니다


, NIS서비스는 NIS마스트서버와 NIS슬레이브서버 그리고 NIS서버들의 정보를 이용하는 NIS클라이언트들로 구성되어 있습니다


이런 NIS환경에서 NIS도메인은 동일한 NIS데이터베이스(NIS)을 공유하는 호스트들의 그룹과 같은 개념입니다.

 

다시 말씀드린다면 여기서 말하는 NIS도메인은 우리가 흔히 말하는 인터넷도메인과는 그 의미가 완전히 다른 것입니다


호스트명, 사용자명등의 동일한 네트웍자원을 공유할 수 있는 일종의 네트웍 영역이름을 의미합니다. 

 

쉽게 표현한다면 동일한 네트웍자원을 공유할 수 있는 호스트들의 그룹이름이라고 할 수 있습니다


이런 개념에서 본다면 윈도우NT서버나 윈도우 2000서버등에서 의미하는 도메인의 개념과 거의 유사하다고 할 수 있습니다.

 

따라서 NIS도메인이란 NIS마스트서버와 슬레이브서버에서 보유한 NIS데이터베이스정보(동일한 네트웍자원)를 함께 사용하고 공유하는 호스트(컴퓨터)들의 그룹이름입니다.

 

그리고 NIS도메인명은 NIS Master Server, NIS Slave Server, NIS Client모두에 설정이 되어야하며 그 이름 또한 동일해야합니다.

 

, ypdomainname명령어는 이런 NIS환경에서 동일한 NIS도메인을 설정하기 위하여 NIS마스터서버, NIS슬레이브서버, 그리고 NIS클라이언트에서 NIS도메인을 설정하고 확인하는 NIS명령어입니다


다음예는 NIS마스터서버에서 NIS도메인으로 superuser를 설정한 것입니다.

 

[root@command yp]# ypdomainname superuser

[root@command yp]#

 

그리고 다음은 NIS도메인을 확인한 것입니다. 그 결과 현재 서버의 NIS도메인은 superuser로 설정되어 있음을 알 수 있습니다.

 

[root@command yp]# ypdomainname

superuser

[root@command yp]#

 

위의 예와같이 NIS도메인을 설정하고 확인하는 방법은 NIS마스터서버와 NIS슬레이브서버, 그리고 NIS클라이언트에서 모두 동일한 방법으로 사용하실 수 있습니다.

 

그리고 ypdomainname명령어는 NIS도메인네임의 확인과 설정을 하는 nisdomainname명령어와 동일한 역할을하는 명령어입니다.

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,034 명
  • 현재 강좌수 :  35,791 개
  • 현재 접속자 :  220 명