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

De WikiLICC
Ir para: navegação, pesquisa
m (Referências)
m (Setting up a NIS master server)
Linha 40: Linha 40:
 
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:
+
* Edite /etc/yp.conf:
 
  domain internal server ip.of.nis.server
 
  domain internal server ip.of.nis.server
 +
domain nismatrix server 192.168.0.99
  
Edit /etc/ypserv.conf:
+
Edite /etc/ypserv.conf:
 
+
..
 
  dns: no
 
  dns: no
 
  files: 30
 
  files: 30
Linha 51: Linha 52:
 
  * : * : passwd.adjunct.byname : port  
 
  * : * : passwd.adjunct.byname : port  
  
Edit /etc/sysconfig/network:
+
Edite /etc/sysconfig/network:
  
  NISDOMAIN="internal"
+
  NISDOMAIN="nismatrix"
  
Set NIS domain name:
+
Setar NIS domain name:
  
  master# domainname internal
+
  one# domainname nismatrix
  master# ypdomainname internal
+
  one# ypdomainname nismatrix
  
 
Create file /var/yp/securenets:
 
Create file /var/yp/securenets:
Linha 72: Linha 73:
 
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.
  
Start ypserv service:
+
Inicie o serviço ypserv:
 +
one# service ypserv start
  
master# service ypserv start
+
Verifique se está escutando
 
+
  one# rpcinfo -u localhost ypserv
Check that it's listening:
 
 
 
  master# rpcinfo -u localhost ypserv
 
 
 
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:
+
Inicialize o mapeamento NIS:
  master# /usr/lib/yp/ypinit -m
+
  one# /usr/lib64/yp/ypinit -m
 
+
Especifique one.matrix, Ctrl-D, y, e deixe finalizar.
Specify local hostname, Ctrl-D, y, let finish.
 
  
Start up ypbind, yppasswdd, ypxfrd:
+
Inicie ypbind, yppasswdd, ypxfrd:
  
  master# service ypbind start
+
  one# service ypbind start
  master# service yppasswdd start
+
  one# service yppasswdd start
  master# service ypxfrd start
+
  one# service ypxfrd start
  
 
Set YP services to run on boot-up:
 
Set YP services to run on boot-up:
  
  master# chkconfig ypserv on
+
  one# chkconfig ypserv on
  master# chkconfig ypbind on
+
  one# chkconfig ypbind on
  master# chkconfig yppasswdd on
+
  one# chkconfig yppasswdd on
  master# chkconfig ypxfrd on
+
  one# chkconfig ypxfrd on
  
 
===NIS client host setup===
 
===NIS client host setup===

Edição das 22h32min 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.

  • Edite /etc/yp.conf:
domain internal server ip.of.nis.server
domain nismatrix server 192.168.0.99

Edite /etc/ypserv.conf:

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

Edite /etc/sysconfig/network:

NISDOMAIN="nismatrix"

Setar NIS domain name:

one# domainname nismatrix
one# ypdomainname nismatrix

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.

Inicie o serviço ypserv:

one# service ypserv start

Verifique se está escutando

one# rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting

Inicialize o mapeamento NIS:

one# /usr/lib64/yp/ypinit -m

Especifique one.matrix, Ctrl-D, y, e deixe finalizar.

Inicie ypbind, yppasswdd, ypxfrd:

one# service ypbind start
one# service yppasswdd start
one# service ypxfrd start

Set YP services to run on boot-up:

one# chkconfig ypserv on
one# chkconfig ypbind on
one# chkconfig yppasswdd on
one# 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