Skip to content

Instantly share code, notes, and snippets.

@ErickAgrazal
Last active July 13, 2019 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErickAgrazal/c3606d9a9b07adcddd32a3eb2478aa1f to your computer and use it in GitHub Desktop.
Save ErickAgrazal/c3606d9a9b07adcddd32a3eb2478aa1f to your computer and use it in GitHub Desktop.
Línea base de seguridad de ubuntu server

Agregar las interfaces de red usando netplan

  1. En sudo vim /etc/netplan/01-netcfg.yaml agregar lo siguiente:
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s8:
      dhcp4: yes
      dhcp6: yes
    enp0s3:
      dhcp4: yes
      dhcp6: yes
  1. Actualizar la nueva confiración. $ sudo netplan apply

Agregar las configuraciones del SSH

  1. Reemplazar el contenido de sudo vim /etc/ssh/sshd_config, por agregar lo siguiente:
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem	sftp	/usr/lib/openssh/sftp-server

## Configuraciones especiales
Protocol 2
AllowGroup sshaccess
ClientAliveInterval 300
ClientAliveCountMax 0
IgnoreRhosts yes
HostbasedAuthentication no
PermitRootLogin no
Port 22
PermitEmptyPasswords no
Banner /etc/banner.txt
  1. Agregar el archivo sudo vim /etc/banner.txt:
###################################################
################### Proyeco X #####################
###################################################
  1. Reiniciar el servicio de SSH con /etc/init.d/ssh restart

Agregar las configuraciones de Postfix

  1. Instalar con: sudo apt-get -y install libsasl2-modules postfix
  2. Pasos del formulario:
  • 2.1 Elegir la opción Internet Site
  • 2.2 Colocar el dominio de preferencia. En este caso estoy colando proyecto.com.
  • 2.3 Cambiar la opción myhostname = por el dominio elegido en el punto 2.2. En este caso: proyecto.com.
  1. Conectar con SMTP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment