Secure SSH Key Login on Ubuntu: No Root, No Password

Lock down your Ubuntu server by enabling SSH key authentication and disabling both root and password logins. In this step-by-step beginner guide, youโ€™ll crea...

Secure SSH Key Login on Ubuntu: No Root, No Password
Tony Teaches Tech
15.7K views โ€ข Jun 2, 2025
Secure SSH Key Login on Ubuntu: No Root, No Password

About this video

Lock down your Ubuntu server by enabling SSH key authentication and disabling both root and password logins. In this step-by-step beginner guide, youโ€™ll create a non-root sudo user, generate a key pair, copy your public key to your server, and harden your sshd_config so only key-based logins are permitted.

Help me decide what videos to make next ๐Ÿ‘‰ https://ttt.do/future-tutorials (survey link)

โช Watch previous (firewall setup): https://youtu.be/68GTL7djIMI
๐Ÿ“บ Full Playlist โ€“ Build & Secure Your VPS Website: https://www.youtube.com/playlist?list=PL_vyuxE-AO-CuU7E2KfT2bDwVL63v28JZ

What Youโ€™ll Learn
โœ… Add a non-root user with sudo privileges
โœ… Generate SSH key pair with ssh-keygen
โœ… Copy your public key with ssh-copy-id
โœ… Disable root login and password authentication
โœ… Update sshd_config for key-only access
โœ… Restart SSH and verify your hardened setup

โฑ๏ธ Chapters
00:00 Intro & why key-based SSH matters
00:36 Create a non-root sudo user
01:37 Use native SSH client
02:35 Generate SSH key pair
03:36 Copy your public key to the server
04:30 Test key-only SSH login
04:45 Edit /etc/ssh/sshd_config
07:04 Restart SSH service
07:34 Verify root and password logins are disabled

Important sshd_config File Changes:
PermitRootLogin no
PasswordAuthentication nos
PermitEmptyPasswords no
KbdInteractiveAuthentication no
UsePAM no
X11Forwarding no
AuthenticationMethods publickey
AllowUsers tony

Video Information

Views

15.7K

Likes

540

Duration

8:39

Published

Jun 2, 2025

User Reviews

4.6
(3)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.

Trending Now