Página siguiente Página anterior Índice general

5. Modificación de servicios

Una de las virtudes de Linux es su gran flexibilidad para su configuración. De allí que se requieran hacer al menos los siguientes cambios para tener un ambiente uniforme en el CIE.

5.1 issue

El mensaje de identificación de RedHat proporciona el nombre de la distribución instalada, información que puede ser utilizada para atacar al sistema. Dicho mensaje se almacena en los archivos /etc/issue y /etc/issue.net al momento de iniciar el sistema mediante el programa /etc/rc.d/rc.local.

Debe modificarse /etc/rc.d/rc.local para que quede como sigue:


#!/bin/bash

# This will overwrite /etc/issue at every boot.  So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
cat > /etc/issue << -EOF-

Centro de Investigación en Energía
Welcome to $(uname -srm)
-EOF-

cp -f /etc/issue /etc/issue.net
echo >> /etc/issue

# Aquí se pueden añadir otros servicios locales

5.2 inetd

inetd(8) es el programa que escucha las peticiones de conexión de equipos remotos. Los equipos configurados como estaciones de trabajo personales no deberían proporcionar servicios de red. De ser posible debe ser deshabilitado mediante

# chkconfig --level 23 inetd off

Cuando no es posible tomar esta medida radical, es necesario reducir el número de servicios proporcionados por inetd al mínimo y configurar tcpd (v. tcpd).

5.3 tcpd

tpcd(8) proporciona un mecanismo de seguridad elemental para los servicios proporcionados por inetd(8). Se requiere configurar dos archivos: /etc/hosts.allow y /etc/hosts.deny.

Existen varias estrategias de configuración para tpcd, que pueden consultarse en hosts_access(5). En el CIE utilizamos una estrategia simple: se confía plenamente en los equipos de la red local y en ssh, y no confiamos en ningún equipo externo. mazatl tiene una estrategia mucho más abierta, y mucho más susceptible a ataques del exterior, pero es más fácil cuidar a una sóla maquina, que estar cuidando a todas al mismo tiempo.

RedHat instala archivos de control /etc/hosts.{allow,deny} sin reglas de acceso. Se tienen que añadir las siguientes reglas a los archivos correspondientes:


--- hosts.deny.orig     Sat Oct 16 16:14:48 1999
+++ hosts.deny  Sat Oct 16 16:15:05 1999
@@ -7,3 +7,4 @@
 # the new secure portmap uses hosts.deny and hosts.allow.  In particular
 # you should know that NFS uses portmap!
 
+ALL: ALL
--- hosts.allow.orig    Sat Oct 16 16:16:42 1999
+++ hosts.allow Sat Oct 16 16:16:57 1999
@@ -4,3 +4,5 @@
 #              by the '/usr/sbin/tcpd' server.
 #
 
+ALL: 127. 132.248.30.
+sshd: ALL

5.4 samba

samba(7) permite a los equipos Unix, incluyendo Linux, proporcionar servicios de red para windows. No es una tarea sencilla, y requiere de varios programas de apoyo y el archivos de configuración /etc/smb.conf es complejo. Se puede aprender más de las opciones mencionadas en smb.conf(5)


--- /etc/smb.conf.orig  Thu Jul 22 10:40:06 1999
+++ /etc/smb.conf       Mon Oct 18 13:28:54 1999
@@ -15,22 +15,22 @@
 [global]
 
 # workgroup = NT-Domain-Name or Workgroup-Name
-   workgroup = MYGROUP
+   workgroup = CC
 
 # server string is the equivalent of the NT Description field
-   server string = Samba Server
+   server string = I. M. Boring, PhD
 
 # This option is important for security. It allows you to restrict
 # connections to machines which are on your local network. The
 # following example restricts access to two C class networks and
 # the "loopback" interface. For more examples of the syntax see
 # the smb.conf man page
-;   hosts allow = 192.168.1. 192.168.2. 127.
+   hosts allow = 127. 148.218.30.
 
 # if you want to automatically load your printer list rather
 # than setting them up individually then you'll need this
    printcap name = /etc/printcap
-   load printers = yes
+   load printers = no
 
 # It should not be necessary to spell out the print system type unless
 # yours is non-standard. Currently supported print systems include:
@@ -43,10 +43,10 @@
 
 # this tells Samba to use a separate log file for each machine
 # that connects
-   log file = /var/log/samba/log.%m
+   log file = /var/log/samba/%m
 
 # Put a capping on the size of the log files (in Kb).
-   max log size = 50
+   max log size = 16
 
 # Security mode. Most people will want user level security. See
 # security_level.txt for details.
@@ -87,6 +87,11 @@
 # See speed.txt and the manual pages for details
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
 
+# More optimization options
+   keep alive = 60
+   dead time = 5
+   debug level = 1
+
 # Configure Samba to use multiple interfaces
 # If you have multiple network interfaces then you must list them
 # here. See the man page for details.
@@ -102,7 +107,7 @@
 # Browser Control Options:
 # set local master to no if you don't want Samba to become a master
 # browser on your network. Otherwise the normal election rules apply
-;   local master = no
+   local master = no
 
 # OS Level determines the precedence of this server in master browser
 # elections. The default value should be reasonable
@@ -156,7 +161,7 @@
 
 # WINS Server - Tells the NMBD components of Samba to be a WINS Client
 #      Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
-;   wins server = w.x.y.z
+   wins server = 132.248.30.3
 
 # WINS Proxy - Tells Samba to answer name resolution queries on
 # behalf of a non WINS capable client, for this to work there must be

Servidores de Archivos

Algunos equipos Linux en el CIE están configurados para proporcionar servicios de archivos para la red de Windows. Estos equipos también están configurados como servidores maestros para los nombres de windows:

Grupo   Servidor
-----   --------
CC      MAZATL
MES     COAMITL
FT      TOCATL
TEYM    NELLI
SE      HUIPILLI

En estos equipos, se requiere la siguiente configuración adicional:


--- smb.conf.orig       Mon Oct 18 13:32:07 1999
+++ smb.conf    Mon Oct 18 13:33:15 1999
@@ -107,20 +107,20 @@
 # Browser Control Options:
 # set local master to no if you don't want Samba to become a master
 # browser on your network. Otherwise the normal election rules apply
-   local master = no
+   local master = yes
 
 # OS Level determines the precedence of this server in master browser
 # elections. The default value should be reasonable
-;   os level = 33
+   os level = 33
 
 # Domain Master specifies Samba to be the Domain Master Browser. This
 # allows Samba to collate browse lists between subnets. Don't use this
 # if you already have a Windows NT domain controller doing this job
-;   domain master = yes 
+   domain master = yes 
 
 # Preferred Master causes Samba to force a local browser election on startup
 # and gives it a slightly higher chance of winning the election
-;   preferred master = yes
+   preferred master = yes
 
 # Use only if you have an NT server on your network that has been
 # configured at install time to be a primary domain controller.

Para añadir más directorios compartidos consulte smb.conf(5).

5.5 logrotate

RedHat establece un mecanismo de rotación de las bitácoras del sistema mediante logrotate(8). Se puede configurar para que las bitácoras antiguas se almacenen comprimidas para ahorrar espacio en disco. Esto es especialmente útil en equipos que requieren poca atención del administrador.


--- logrotate.conf.orig Mon Oct 18 16:51:07 1999
+++ logrotate.conf      Mon Oct 18 16:51:37 1999
@@ -12,7 +12,7 @@
 create
 
 # uncomment this if you want your log files compressed
-#compress
+compress
 
 # RPM packages drop log rotation information into this directory
 include /etc/logrotate.d

5.6 fstab

Los equipos Linux asignados como estaciones de trabajo personales tienen ciertas características que hacen deseable la modificación del archivo /etc/fstab. Estas modificaciones no deben aplicarse en otras configuraciones.

En los equipos multiusuario, sólo root puede poner y quitar sistemas de archivos mediente las órdenes mount(8) y umount(8). Pero en las estaciones de trabajo personales esta restricción no es aplicable, pues root también es el usuario primario del sistema. Por lo tanto, es posible añadir la opción user en /etc/fstab para permitirle al usuario poner y quitar sistemas de archivos como diskettes, zips y discos compactos.


--- fstab.orig  Sat Oct 16 16:30:33 1999
+++ fstab       Sat Oct 16 16:30:52 1999
@@ -4,8 +4,8 @@
 /dev/hda7               /usr/local              ext2    defaults        1 2
 /dev/hda8               /home                   ext2    defaults        1 2
 /dev/hda4               swap                    swap    defaults        0 0
-/dev/fd0                /mnt/floppy             ext2    noauto          0 0
-/dev/cdrom              /mnt/cdrom              iso9660 noauto,ro       0 0
-/dev/hdd4               /mnt/zip                ext2    noauto          0 0
+/dev/fd0                /mnt/floppy             ext2    noauto,user     0 0
+/dev/cdrom              /mnt/cdrom              iso9660 noauto,ro,user  0 0
+/dev/hdd4               /mnt/zip                ext2    noauto,user     0 0
 none                    /proc                   proc    defaults        0 0
 none                    /dev/pts                devpts  gid=5,mode=620  0 0

Si se añade al panel de gnome el applet "drive mount" es facilita la tarea de poner y quitar estos medios removibles.


Página siguiente Página anterior Índice general