Bots are guessing passwords on every server connected to the internet, all day, every day. In this episode you'll lock that door for good: how SSH keys work, how to create an ed25519 key, copy it to your server with ssh-copy-id, use an SSH config file so you can just type "ssh srv01", and harden your server by turning off password and root login, safely, without locking yourself out.
⏱ Chapters
0:00 Bots are guessing your password
0:19 How SSH keys work
0:42 Create a key (ssh-keygen)
1:08 Copy it to the server (ssh-copy-id)
1:35 SSH config: nicknames
1:58 Disable passwords & root login
2:32 Test before you log out
2:47 Extra layers (fail2ban, firewall)
3:13 Common mistakes
3:44 Cheat sheet
4:02 Like & subscribe
4:14 Homework & up next
⌨️ Commands from this video
On your laptop:
ssh-keygen -t ed25519 -C "kakha@laptop" create a key pair (use a passphrase!)
ssh-copy-id kakha@192.168.1.50 copy the public key to the server
ssh kakha@192.168.1.50 log in with the key
nano ~/.ssh/config add a nickname (Host srv01 ...)
ssh srv01 log in with the nickname
ssh-keygen -R 192.168.1.50 remove an old host key after a reinstall
chmod 600 ~/.ssh/id_ed25519 fix "unprotected private key file"
On the server:
sudo nano /etc/ssh/sshd_config.d/00-hardening.conf
PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
sudo sshd -t test the config syntax
sudo sshd -T | grep -E 'passwordauth|permitroot' show the settings that are really active
sudo systemctl restart ssh apply
⚠️ Before turning off passwords: make sure key login works, keep your session open, and test from a NEW terminal.
🔑 Only the .pub file ever leaves your laptop. Never share the private key.
📺 Full course playlist:
◀ Previous – #9 Networking Basics: IP, DNS & Ports: [EP9 LINK]
▶ Next – #11 Services with systemd: coming soon
💬 Homework: create a key, copy it to your server, add a nickname in your SSH config, then turn off password login (test first!). Did it work? Tell me in the comments!
👍 If this helped, like & subscribe, it keeps the course free.
© netacademy.ge
#Linux #UbuntuServer #SSH