# Debian Server Setup Here's the minimum setup I put on my Debian 12 Bookworm servers. ## System configuration ``` # system updates sudo apt update sudo apt install -y openssh-server mosh ufw vim sudo apt upgrade -y sudo apt autoremove -y # use Vim sudo update-alternatives --config editor # OpenSSH & Mosh & UFW sudo groupadd --system ssh-users sudo usermod -aG ssh-users $(whoami) sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak sudo wget \ https://git.duckduckwhale.com/DuckDuckWhale/dotfiles/raw/branch/main/system/sshd/sshd_config-debian \ -O /etc/ssh/sshd_config sudo systemctl enable ssh --now sudo systemctl reload ssh sudo ufw limit OpenSSH # sudo ufw limit 22/tcp sudo ufw allow mosh # sudo ufw allow 60001:60999/udp # mosh profile includes unused 60000 & 61000 sudo ufw enable # sanity check systemctl status ssh sudo ufw status su - $(whoami) # apply all settings sudo reboot ``` ## User SSH keys ``` mkdir -p ~/.ssh chmod 700 ~/.ssh # insert your SSH public keys into the file touch ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys ```