💾 Archived View for elmau.net › notes › ubuntuserver.gmi captured on 2024-07-08 at 23:55:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-07-22)

-=-=-=-=-=-=-

Ubuntu Server 22.04

Agregar un usuario.

adduser USER

Agregar un usuario al grupo "sudo".

gpasswd -a USER sudo

Establecer el uso horario

sudo timedatectl set-timezone America/Mexico_City

Mantener actualizado el servidor


sudo apt update

sudo apt upgrade

Establecer locales

sudo localectl set-locale LANG=en_US.UTF-8 LANGUAGE="en_US:en"

sudo vim /etc/environment

    LANG=en_US.UTF-8
    LC_ALL=en_US.UTF-8

Limpiar locales no utilizados


sudo dpkg-reconfigure locales

Establecer un mejor prompt

vim .bashrc

    PS1="┌─[\e[0;32m\H\e[m][\e[1;31m\u\e[m]->{\[\e[34;1m\]\w\[\e[0;0m\]}\n└──> \[\e[0m\]"

source .bashrc

Establecer el hostname


sudo hostnamectl set-hostname elmau.net

sudo vim /etc/hosts

    127.0.0.1 elmau.net localhost

Establecer configuraciĂłn para `ssh`


sudo vim /etc/ssh/sshd_config

Port 2274
AllowUsers USER
LoginGraceTime 1m
ClientAliveInterval 600
ClientAliveCountMax 0
MaxAuthTries 3
IgnoreRhosts yes
PermitEmptyPasswords no
LogLevel INFO

PasswordAuthentication no
PermitRootLogin no

sudo systemctl restart ssh

Desactivar los mensajes de Ubuntu al entrar


sudo chmod -x /etc/update-motd.d/50-motd-news
sudo chmod -x /etc/update-motd.d/00-header
sudo chmod -x /etc/update-motd.d/10-help-text

Instalar certbot

sudo apt install certbot

sudo certbot register --agree-tos -m EMAIL

Instalar firewall


sudo apt install ufw

sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https

sudo ufw allow PORT/tcp

sudo ufw enable

sudo apt update

sudo apt upgrade

sudo apt install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

apt-cache policy docker-ce

sudo apt install docker-ce

sudo systemctl status docker

sudo usermod -aG docker USERNAME

Cambiar limite de archivos abiertos

sudo vim /etc/security/limits.conf

    *       soft    nofile  20480

Regresar el Ă­ndice

Regresar el inicio