Beruflich Dokumente
Kultur Dokumente
Capítulo 31:
El Servidor NIS
• ¿Qué es NIS?
• ¿Quiénes componen un dominio NIS?
• ¿Cómo trabaja NIS?
• Servicios y procesos NIS.
• Configuración de NIS.
• Creando y actualizando nuevos mapas NIS.
• Recursos adicionales.
Sistema Operativo Linux
Capítulo 31: El Servidor NIS
El servidor NIS
31.1. ¿Qué es NIS?
NIS, siglas de Network Information Services (Servicios de Información de Red), fué un servicio
desarrollado por Sun Microsystems con la finalidad de centralizar la administración de sistemas
UNIX. Hoy NIS es considerado como un estándar de la industria, tal es así que Solaris, HP-UX,
AIX, Linux, NetBSD, OpenBSD, FreeBSD, y otros sistemas, implementan NIS.
NIS se conoció como el servicio de páginas amarillas (yellow pages o yp) pero debido a problemas
legales debidos a la propiedad de marcas comerciales, Sun tuvo que cambiar el nombre. Como
rastro de esto es que muchos de sus comandos comienzan con yp.
NIS es un sistema cliente servidor basado en llamadas RPC que permite a un grupo de máquinas
que se encuentran definidas dentro de un dominio administrativo NIS compartir un conjunto
de archivos de configuración. Esto permite al administrador de sistemas por un lado configurar
clientes NIS de forma sencilla y por otro lado centralizar la gestión de los archivos de configuración
en una única ubicación (una sola máquina).
Sistema Operativo Linux
Capítulo 31: El Servidor NIS
Términos Descripción
Sistema Operativo Linux
Comandos:
/bin/ypdomainname /usr/bin/ypwhich
/bin/nisdomainname /usr/sbin/ypserv
/usr/bin/ypchsh /usr/sbin/yppush
/usr/bin/ypmatch /usr/sbin/yptest
/usr/bin/ypchfn /usr/sbin/ypset
/usr/bin/yppasswd /usr/sbin/yppoll
/usr/bin/ypcat
Archivos de configuración:
/etc/yp.conf
/etc/ypserv.conf
/usr/share/doc/ypserv-2.13/securenets Directorios con documentos sencillos:
Shells: /usr/share/doc/ypbind-1.17.2/*
/etc/rc.d/init.d/ypbind /usr/share/doc/yp-tools-2.8/*
/etc/rc.d/init.d/yppasswdd /usr/share/doc/ypserv-2.13/*
/etc/rc.d/init.d/ypserv
/etc/rc.d/init.d/ypxfrd
/etc/sysconfig/yppasswdd
Comandos:
/usr/lib/yp/create_printcap
/usr/lib/yp/ypinit
/usr/lib/yp/mknetid
/usr/lib/yp/yphelper
/usr/lib/yp/makedbm
/usr/lib/yp/ypxfr
/usr/lib/yp/pwupdate
/usr/lib/yp/ypxfr_2perday
/usr/lib/yp/match_printcap
/usr/lib/yp/ypxfr_1perhour
/usr/lib/yp/revnetgroup
/usr/lib/yp/ypxfr_1perday
Capítulo 31: El Servidor NIS
Sistema Operativo Linux
Capítulo 31: El Servidor NIS
Sistema Operativo Linux
El servicio ypserv toma información del archivo /etc/ypserv.conf que es un archivo ASCII que
contiene algunas opciones de configuración para ypserv. También contiene una lista de reglas para
un anfitrión (host) especial y mapas de acceso para ypserv y rpc.ypxfrd. Este archivo será leído
por ypserv y rpc.ypxfrd al iniciarse el sistema, o cuando reciba una señal SIGHUP.
A continuación el contenido por defecto del archivo de configuración de ypserv:
[root@fedora3 ~]# 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
# Should we register ypserv with SLP ?
slp: no
# After how many seconds we should re-register ypserv with SLP ?
slp_timeout: 3600
# 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
10
Capítulo 31: El Servidor NIS
# 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
11
Sistema Operativo Linux
El demonio ypbind corre en un cliente NIS/YP y se enlaza a un dominio NIS. Este demonio lee
la información del archivo /etc/yp.conf.
A continuación el contenido por defecto del archivo de configuración de ypbind:
[root@fedora3 ~]# cat /etc/yp.conf
# /etc/yp.conf - ypbind configuration file
# Valid entries are
#
# domain NISDOMAIN server HOSTNAME
# Use server HOSTNAME for the domain NISDOMAIN.
#
# domain NISDOMAIN broadcast
# Use broadcast on the local net for domain NISDOMAIN
#
# domain NISDOMAIN slp
# Query local SLP server for ypserver supporting NISDOMAIN
#
# ypserver HOSTNAME
# Use server HOSTNAME for the local domain. The
# IP-address of server must be listed in /etc/hosts.
#
# broadcast
# If no server for the default domain is specified or
# none of them is rechable, try a broadcast call to
# find a server.
#
domain ici.edu.pe server 192.168.1.243
12
Capítulo 31: El Servidor NIS
13
Sistema Operativo Linux
14
Capítulo 31: El Servidor NIS
15
Sistema Operativo Linux
16
Capítulo 31: El Servidor NIS
7. Compilar:
[root@fedora3 yp]# make
gmake[1]: Entering directory `/var/yp/ici.edu.pe’
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/ici.edu.pe’
8. Predeterminar en el servidor Linux Fedora los siguientes servicios, que deben iniciarse desde
el inicio en el servidor:
/usr/sbin/ypserv
/usr/sbin/ypbind
/sbin/portmap
Verificación:
Se ejecutarán algunos comandos para certificar la configuración del servicio NIS:
[root@fedora3 ~]# nisdomainname
ici.edu.pe
17
Sistema Operativo Linux
6. En el servidor deben de estar seleccionados los servicios siguientes para arrancar desde el
inicio del sistema.
/usr/sbin/ypbind
/sbin/portmap
Resumiendo:
Trabajando como cliente NIS debe correr ypbind. Este servicio debe correr en cada máquina que
se comporta como un cliente de NIS. Para los usuarios normales, usted necesita yp-tools.
Este paquete provee las siguientes herramientas:
• Orientadas a la comunicación:
o ypbind.
o ypset.
o ypwhich.
• Para acceder a los mapas NIS:
o ypcat.
o ypmatch.
o yppoll.
• Para cambiar la información del usuario:
o ypchfn.
o ypchsh.
o yppasswd.
19
Sistema Operativo Linux
20
Capítulo 31: El Servidor NIS
21
Sistema Operativo Linux
22