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 24,300 courses taught by industry experts.
Terminating SSH connections, part 2 - Linux Tutorial
From the course: Complete Guide to Linux Security: Protecting Your Linux Server Environment
Terminating SSH connections, part 2
- You may find that you want to auto-terminate sessions after a specific amount of inactivity. This used to be available within the OpenSSH server. And if we look at our server, we'll see there was two items that you would modify: ClientAliveInterval, and ClientAliveCountMax. But as of OpenSSH 8.2, that was discontinued. So I'm going to show a way to auto-terminate any session into the terminal for the individual user, and globally. So let's get out of here and not save that file. And at the SSH server, what I'm going to do is I'm going to configure a timeout for our user, and then globally. We'll start with the individual user. And what I'm going to do is I'm going to create a new file for our user account. So I'm going to do a vim on /home/user. And I'm going to create a new file .bash_profile. If there is a .bash_profile already, you can just augment that. But on this server, there is no such file for the user account, so I'm creating a new one. And in that file, I'm going to use…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Learning objectives1m 18s
-
(Locked)
Review of SSH1m 47s
-
(Locked)
Using keys to connect via SSH12m 57s
-
(Locked)
The sshd_config file3m 19s
-
(Locked)
Modifying the default SSH port7m 32s
-
(Locked)
Disabling password-based SSH2m 57s
-
(Locked)
Disabling root login via SSH2m 32s
-
(Locked)
Exclusive SSH groups4m 37s
-
(Locked)
Authentication settings10m 6s
-
(Locked)
Terminating SSH connections, part 17m 45s
-
(Locked)
Terminating SSH connections, part 26m 51s
-
(Locked)
-
-
-
-
-