Mudanças entre as edições de "Minicluster:NIS"

De WikiLICC
Ir para: navegação, pesquisa
m (Cliente NIS)
m (Cliente NIS)
Linha 26: Linha 26:
  
  
 
+
== config ==
 
The following describes a procedure to set up NIS network name service under Red Hat Linux. This is geared toward a small intallation with only one domain. However, it should be fairly evident how to add more NIS domains. The NIS domain name has nothing to do with any DNS naming convention being used.
 
The following describes a procedure to set up NIS network name service under Red Hat Linux. This is geared toward a small intallation with only one domain. However, it should be fairly evident how to add more NIS domains. The NIS domain name has nothing to do with any DNS naming convention being used.
  
 
In these examples, the following conventions are used:
 
In these examples, the following conventions are used:
NIS domain: "internal"
+
;NIS domain: "internal"
Code or configuration file data: colored
+
;Code or configuration file data: colored
Root prompt on NIS master server: master#
+
;Root prompt on NIS master server: master#
Root prompt on NIS client host: client#
+
;Root prompt on NIS client host: client#
Setting up a NIS master server:
+
;Setting up a NIS master server:
  
Required packages: yp-tools ypbind ypserv portmap
+
;Required packages: yp-tools ypbind ypserv portmap
  
 
Set up "time" service to run via inetd/xinetd, or configure xntpd, or otherwise make sure the host's clock is synchronized.
 
Set up "time" service to run via inetd/xinetd, or configure xntpd, or otherwise make sure the host's clock is synchronized.
  
 
Edit /etc/yp.conf:
 
Edit /etc/yp.conf:
 
+
domain internal server ip.of.nis.server
domain internal server ip.of.nis.server
 
  
 
Edit /etc/ypserv.conf:
 
Edit /etc/ypserv.conf:
  
dns: no
+
dns: no
files: 30
+
files: 30
xfr_check_port: yes
+
xfr_check_port: yes
* : * : shadow.byname : port
+
* : * : shadow.byname : port
* : * : passwd.adjunct.byname : port  
+
* : * : passwd.adjunct.byname : port  
  
 
Edit /etc/sysconfig/network:
 
Edit /etc/sysconfig/network:
  
NISDOMAIN="internal"
+
NISDOMAIN="internal"
  
 
Set NIS domain name:
 
Set NIS domain name:
  
master# domainname internal
+
master# domainname internal
master# ypdomainname internal
+
master# ypdomainname internal
  
 
Create file /var/yp/securenets:
 
Create file /var/yp/securenets:
  
host 127.0.0.1
+
host 127.0.0.1
255.255.255.0  10.0.0.0
+
255.255.255.0  10.0.0.0
  
 
Make sure the "portmap" service is running:
 
Make sure the "portmap" service is running:
  
master# service portmap start
+
master# service portmap start
master# chkconfig portmap on
+
master# chkconfig portmap on
  
 
Portmap will need a rule in /etc/hosts.allow to allow access from localhost and any hosts that need to access NIS.
 
Portmap will need a rule in /etc/hosts.allow to allow access from localhost and any hosts that need to access NIS.
Linha 75: Linha 74:
 
Start ypserv service:
 
Start ypserv service:
  
master# service ypserv start
+
master# service ypserv start
  
 
Check that it's listening:
 
Check that it's listening:
  
master# rpcinfo -u localhost ypserv
+
master# rpcinfo -u localhost ypserv
  
 
You should see:
 
You should see:
 
+
program 100004 version 1 ready and waiting
program 100004 version 1 ready and waiting
+
program 100004 version 2 ready and waiting
program 100004 version 2 ready and waiting
 
  
 
Initialize the NIS maps:
 
Initialize the NIS maps:
 
+
master# /usr/lib/yp/ypinit -m
master# /usr/lib/yp/ypinit -m
 
  
 
Specify local hostname, Ctrl-D, y, let finish.
 
Specify local hostname, Ctrl-D, y, let finish.
Linha 94: Linha 91:
 
Start up ypbind, yppasswdd, ypxfrd:
 
Start up ypbind, yppasswdd, ypxfrd:
  
master# service ypbind start
+
master# service ypbind start
master# service yppasswdd start
+
master# service yppasswdd start
master# service ypxfrd start
+
master# service ypxfrd start
  
 
Set YP services to run on boot-up:
 
Set YP services to run on boot-up:
  
master# chkconfig ypserv on
+
master# chkconfig ypserv on
master# chkconfig ypbind on
+
master# chkconfig ypbind on
master# chkconfig yppasswdd on
+
master# chkconfig yppasswdd on
master# chkconfig ypxfrd on
+
master# chkconfig ypxfrd on
  
NIS client host setup
+
===NIS client host setup===
  
 
Required packages: yp-tools ypbind portmap
 
Required packages: yp-tools ypbind portmap
Linha 111: Linha 108:
 
Edit /etc/sysconfig/network:
 
Edit /etc/sysconfig/network:
  
NISDOMAIN=internal
+
NISDOMAIN=internal
  
 
Edit /etc/yp.conf:
 
Edit /etc/yp.conf:
  
domain internal server ip.of.master.server
+
domain internal server ip.of.master.server
  
 
Edit /etc/hosts:
 
Edit /etc/hosts:
  
ip.of.master.server    hostname.domain hostname
+
ip.of.master.server    hostname.domain hostname
  
 
Set NIS domain-name:
 
Set NIS domain-name:
  
client# domainname internal
+
client# domainname internal
client# ypdomainname internal
+
client# ypdomainname internal
  
 
Edit /etc/nsswitch.conf:
 
Edit /etc/nsswitch.conf:
  
passwd:    files nis
+
passwd:    files nis
shadow:    files nis
+
shadow:    files nis
group:      files nis
+
group:      files nis
  
 
Make sure the portmap service is running:
 
Make sure the portmap service is running:
  
client# service portmap start
+
client# service portmap start
client# chkconfig portmap on
+
client# chkconfig portmap on
  
 
The /etc/hosts.allow file will need rules allowing access from localhost and the NIS master server.
 
The /etc/hosts.allow file will need rules allowing access from localhost and the NIS master server.
Linha 141: Linha 138:
 
Start ypbind service:
 
Start ypbind service:
  
client# service ypbind start
+
client# service ypbind start
client# chkconfig ypbind on
+
client# chkconfig ypbind on
  
 
Test it out:
 
Test it out:
  
client# rpcinfo -u localhost ypbind
+
client# rpcinfo -u localhost ypbind
client# ypcat passwd
+
client# ypcat passwd
  
 
== Referências ==
 
== Referências ==
 
* http://under-linux.org/wiki/Tutoriais/LDAP/LDAP-NIS-NFS
 
* http://under-linux.org/wiki/Tutoriais/LDAP/LDAP-NIS-NFS
 
* http://www.wellho.net/solutions/general-what-are-nis-ldap-dns-and-bind.html
 
* http://www.wellho.net/solutions/general-what-are-nis-ldap-dns-and-bind.html

Edição das 15h44min de 8 de julho de 2010

Servidor NIS

  • Instale o servidor NIS
[root@one]$ yum install ypserv
[root@one]$ chkconfig --level 345 ypserv on
[root@one]$ nisdomainname nismatrix 
[root@one]$ nisdomainname
nismatrix
[root@one]$ /etc/init.d/ypserv start
Starting YP server services:             [  OK  ]
[root@one]$ rpcinfo -u one ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
  • Editar linhas em
[root@one]$ vi /var/yp/Makefile
..
ALIASES     = $(YPSRCDIR)/aliases  # aliases could be in /etc or /etc/mail
#ALIASES    = /etc/mail/aliases
..
  • Gerar o banco de dados no servidor
[root@one]$ /usr/lib64/yp/ypinit -m

Cliente NIS

[root@cell100]$ chkconfig --level 345 ypbind on
nisdomainname nismatrix                                        
[root@cell100] ~ # nisdomainname


config

The following describes a procedure to set up NIS network name service under Red Hat Linux. This is geared toward a small intallation with only one domain. However, it should be fairly evident how to add more NIS domains. The NIS domain name has nothing to do with any DNS naming convention being used.

In these examples, the following conventions are used:

NIS domain
"internal"
Code or configuration file data
colored
Root prompt on NIS master server
master#
Root prompt on NIS client host
client#
Setting up a NIS master server
Required packages
yp-tools ypbind ypserv portmap

Set up "time" service to run via inetd/xinetd, or configure xntpd, or otherwise make sure the host's clock is synchronized.

Edit /etc/yp.conf:

domain internal server ip.of.nis.server

Edit /etc/ypserv.conf:

dns: no
files: 30
xfr_check_port: yes
* : * : shadow.byname : port
* : * : passwd.adjunct.byname : port 

Edit /etc/sysconfig/network:

NISDOMAIN="internal"

Set NIS domain name:

master# domainname internal
master# ypdomainname internal

Create file /var/yp/securenets:

host 127.0.0.1
255.255.255.0   10.0.0.0

Make sure the "portmap" service is running:

master# service portmap start
master# chkconfig portmap on

Portmap will need a rule in /etc/hosts.allow to allow access from localhost and any hosts that need to access NIS.

Start ypserv service:

master# service ypserv start

Check that it's listening:

master# rpcinfo -u localhost ypserv

You should see:

program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting

Initialize the NIS maps:

master# /usr/lib/yp/ypinit -m

Specify local hostname, Ctrl-D, y, let finish.

Start up ypbind, yppasswdd, ypxfrd:

master# service ypbind start
master# service yppasswdd start
master# service ypxfrd start

Set YP services to run on boot-up:

master# chkconfig ypserv on
master# chkconfig ypbind on
master# chkconfig yppasswdd on
master# chkconfig ypxfrd on

NIS client host setup

Required packages: yp-tools ypbind portmap

Edit /etc/sysconfig/network:

NISDOMAIN=internal

Edit /etc/yp.conf:

domain internal server ip.of.master.server

Edit /etc/hosts:

ip.of.master.server    hostname.domain hostname

Set NIS domain-name:

client# domainname internal
client# ypdomainname internal

Edit /etc/nsswitch.conf:

passwd:     files nis
shadow:     files nis
group:      files nis

Make sure the portmap service is running:

client# service portmap start
client# chkconfig portmap on

The /etc/hosts.allow file will need rules allowing access from localhost and the NIS master server.

Start ypbind service:

client# service ypbind start
client# chkconfig ypbind on

Test it out:

client# rpcinfo -u localhost ypbind
client# ypcat passwd

Referências