How to Safely Expose SSH to the Internet | Complete SSH Deep Dive
John Hodson
0:00 / 0:00
How to Safely Expose SSH to the Internet | Complete SSH Deep Dive
195 просмотров · 2 недели назад
John Hodson
276 подписчиков
195 просмотров · 2 недели назад
How do you safely expose an SSH server to the Internet? And what actually happens when you connect to it?
In this tutorial, I take SSH from the practical basics right through to the underlying protocol, showing how to expose SSH safely while explaining what is really happening on both the client and server.
We start by looking at why password authentication is a poor choice for an Internet-facing SSH server. I demonstrate what repeated password attacks look like, including the bandwidth they consume and the noise they create in your logs, and compare this with the immediate rejection you get when the server is configured to accept public-key authentication only.
I then take a detailed look at SSH keys and ssh-keygen, including creating and managing user keys and host keys, and removing public keys when access is no longer required.
From the server side, we examine /etc/ssh/sshd_config, covering common configuration options and building a custom SSH configuration that:
Restricts SSH access to specific users
Disables password authentication
Enforces public-key authentication
Controls other aspects of SSH access and security
Demonstrates how the SSH daemon's configuration affects authentication
Finally, we go much deeper into how SSH actually works.
We follow the SSH protocol and look at how the client and server establish trust, how host authentication works, how user authentication fits into the process, and how Diffie-Hellman key exchange allows the two sides to establish shared session keys without transmitting those keys across the network.
So this isn't just a tutorial on which commands to type. It's a deep dive into SSH from both the administrator's and user's perspective, including what is happening underneath the commands.
In this video
🔐 Public-key authentication🔑 ssh-keygen and SSH keys🖥️ SSH client and server configuration⚙️ /etc/ssh/sshd_config🚫 Disabling password authentication👥 Restricting SSH access to specific users🌐 Safely exposing SSH to the Internet📋 SSH logs and password attacks