HetznerDocs

Search documentation

Find a Hetzner dedicated Linux topic

Command cheat sheet

Same commands as the guides, grouped for a second screen while you are SSH’d into Rescue or the installed OS.

SSH

From your laptop

ssh root@YOUR.SERVER.IPssh -p 222 root@YOUR.SERVER.IPssh-keygen -R YOUR.SERVER.IP

Rescue

Install, mount, chroot

installimagelsblkcat /proc/mdstatmount /dev/md2 /mntmount /dev/mapper/vg0-root /mntchroot-prepare /mntchroot /mntpasswdmdadm --stop /dev/md*wipefs -fa /dev/sd*wipefs -fa /dev/nvme*n1reboot

See disks and RAID

Storage inventory

lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUIDlsblk -fcat /proc/mdstatmdadm --detail /dev/md2pvs; vgs; lvsparted -lblkidfindmnt

Partitioning

Inspect and grow

parted /dev/sda printfdisk -llvextend -r -L +20G /dev/vg0/rootlvextend -r -l +100%FREE /dev/vg0/var

Specs

CPU, RAM, disks, net

hostnamectllscpunprocfree -hdmidecode -t memory | grep Sizelsblk -d -o NAME,SIZE,MODEL,ROTA,TRANsmartctl -a /dev/nvme0n1lspci | grep -i -E 'raid|nvme|ethernet'ip -br aip r

Disk space and RAM

Usage

df -hTdf -idu -h --max-depth=1 / 2>/dev/null | sort -hncdu /free -hhtopps aux --sort=-%mem | headiostat -xz 1 5journalctl --disk-usage

Firewall and ports

Who listens, UFW, iptables

ss -tulpnufw status verboseufw allow OpenSSHiptables -L -n -viptables -t nat -L -n -vnft list ruleset

Ubuntu / Debian after install

Housekeeping

passwdapt updateapt upgrade -yapt install -y sudo vim htop tmux curl ca-certificatestimedatectl