From the course: Linux Hardening

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Limiting logins through SSH (demo)

Limiting logins through SSH (demo) - Linux Tutorial

From the course: Linux Hardening

Limiting logins through SSH (demo)

In this demo, I'm going to show you how to limit login access through SSH. Now, just to show you that things are working, I'm going to actually log into my virtual machine with my user account. Now I'm going to type in the password. And you can see I successfully logged in. Now I'm going to go through the process of disabling or preventing myself from logging in. Now, since I already have a connection, that won't be closed, but we're going to go to the /etc/ssh directory. I'm just going to show you the contents. You see the sshd_config file. But here's the contents of that file. Now I'm searching for deny users, which is the command that I'm going to employ. Since it's not located in this folder, I'm going to actually exit the program. I'm going to go into the sshd_config.d directory, and I'm going to create my custom configuration file right in there. So you have to do this as root because you're in the /etc/ directory and only the root has the permission to write here. Now, I'd use…

Contents