From the course: Complete Guide to Linux Security: Protecting Your Linux Server Environment

Unlock this course with a free trial

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

Exclusive SSH groups

Exclusive SSH groups

- In this portion of the lab, we're going to restrict access to the SSH server by creating an exclusive group. Don't just allow anyone to connect. By creating an exclusive group, we can specify and organize the users and groups of users that are allowed to connect. So we'll go back to our server here. And the first thing I want to do is create a new group. So I'm going to use the addgroup command, and we'll call this ssh-allowed. That'll be the group name, with the new group ID. And now I'm going to add the user account to that group. So we'll do an adduser command, and the user and the group name. Good. So the user named user has been added to the group, ssh-allowed, and that is done. Let's verify the existence of user within that ssh-allowed group. And we'll do groups user. And we see, indeed, user is now a member of ssh-allowed. That's on the end there. You can also do an ID command for a user, and you should see ssh-allowed on the end there as well, with the ID number for that…

Contents