haredning_debian_server
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| haredning_debian_server [2026/02/27 23:30] – created tomek | haredning_debian_server [2026/02/28 01:49] (current) – removed tomek | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Hardening Debian Server ====== | ||
| - | [[https:// | ||
| - | ===== Creating and import ssh key ===== | ||
| - | < | ||
| - | ssh-keygen -t ed25519 -f / | ||
| - | |||
| - | cat a.pub | ssh tomek@192.168.100.105 "mkdir -p ~/.ssh && touch ~/ | ||
| - | |||
| - | // or simply using command ssh-copy-id // | ||
| - | |||
| - | ssh-copy-id -i / | ||
| - | </ | ||
| - | |||
| - | ===== Edit ssh config ===== | ||
| - | < | ||
| - | # nano / | ||
| - | PermitRootLogin no | ||
| - | PubkeyAuthentication yes | ||
| - | PasswordAuthentication no | ||
| - | |||
| - | # systemctl restart ssh | ||
| - | # systemctl restart sshd | ||
| - | </ | ||
| - | |||
| - | ===== Creating basic iptables firewall ===== | ||
| - | < | ||
| - | # touch / | ||
| - | # nano / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | |||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | |||
| - | / | ||
| - | / | ||
| - | / | ||
| - | |||
| - | / | ||
| - | / | ||
| - | |||
| - | for ip in insert_your_ips_here; | ||
| - | / | ||
| - | done | ||
| - | / | ||
| - | |||
| - | # nano / | ||
| - | [Unit] | ||
| - | Description=firewall | ||
| - | After=network.target | ||
| - | |||
| - | [Service] | ||
| - | RemainAfterExit=yes | ||
| - | ExecStart=/ | ||
| - | ExecStop=/ | ||
| - | |||
| - | [Install] | ||
| - | WantedBy=multi-user.target | ||
| - | |||
| - | # systemctl enable firewall | ||
| - | # systemctl start firewall | ||
haredning_debian_server.1772235014.txt.gz · Last modified: by tomek
