wiki:ServBelmez

Version 6 (modified by i22balur, 3 weeks ago) (diff)

--

Características

  • Sistema Operativo: Rocky Linux 9.5 (Blue Onyx)
  • CPU: 2x Procesador Intel® Xeon® E5-2680
  • RAM: 64 GB

Conectividad

  • Hostname: belmezhpe01
  • FQDN: belmezhpe01.priv.uco.es
  • Interfaz eth0
    • VLAN: TODO(No sé el ID) (Aulas)
    • Dirección IP: 172.17.224.251
    • Mascara de subred: 255.255.255.0
    • Gateway: 172.17.224.254

Servicios para arranque remoto

Software instalado:

dnf install dhcp-server
dnf install tftpd
dnf install tftp-server
dnf install nfs-utils
dnf install nmap
dnf install sssd-ldap
dnf install tftp-server

Configuración de NFS

En el /etc/exports exportamos el directorio /TS3 a la subred 172.17.224.0/24 y a TODO(no sé que maquina es sicsop02) (150.214.110.47), mientras que /homes solo a la subred.

/TS3		172.17.224.0/255.255.255.0(ro,no_subtree_check) 150.214.110.47(rw,no_subtree_check,no_root_squash)
/homes		172.17.224.0/255.255.255.0(rw,no_subtree_check)

Configuración de TFTP

En el /etc/systemd/system/tftp-server.service indicamos lo siguiente:

[Unit]
Description=Tftp Server
Requires=tftp-server.socket
Documentation=man:in.tftpd

[Service]
ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
StandardInput=socket

[Install]
Also=tftp.socket

Otros servicios

cron

En el /etc/crontab se invoca /usr/local/bin/crea-homes.sh los días laborales de 8 a 21 cada 5 minutos:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
*/5 8-21  * * 1-5   root    /usr/local/bin/crea-homes.sh

El citado script se encarga de crear, si no existen, los homes de la lista de usuarios que le devuelve ldap1.priv.uco.es. En dicha máquina se ha modificado el /var/home/usulocal/.ssh/.authorized_keys para que cuando root se conecte por ssh desde belmezhpe01 ejecute /usr/bin/cut -d: -f1 /usr/local/uco/pw/pw que devuelve el listado de usuarios.

iptables

Las reglas que se han añadido han sido las siguientes:

iptables -A INPUT -p tcp --dport 2049 -j ACCEPT   # Puerto para NFS
iptables -A INPUT -p udp --dport 2049 -j ACCEPT   # UDP para NFS
iptables -A INPUT -p udp --dport 111 -j ACCEPT    # UDP para rpcbind
iptables -A INPUT -p tcp --dport 20048 -j ACCEPT  # Mountd
iptables -A INPUT -p udp --dport 20048 -j ACCEPT  # Mountd
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited

Al final se tiene lo siguiente:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:nrpe
ACCEPT     udp  --  anywhere             anywhere             udp dpt:tftp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:tftp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:nfs
ACCEPT     udp  --  anywhere             anywhere             udp dpt:nfs
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:sunrpc
ACCEPT     udp  --  anywhere             anywhere             udp dpt:sunrpc
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:mountd
ACCEPT     udp  --  anywhere             anywhere             udp dpt:mountd
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:npp
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER-USER (0 references)
target     prot opt source               destination