Tuesday, August 4, 2015

How to set SSH login limits?

You can limit the maximum number of simultaneous SSH logins by updating the file "/etc/security/limits.conf" with "* maxsyslogins <no.>"

The no. should be a integer.

Below is the description about limits.conf file

[guest@localhost yum.repos.d]$ more /etc/security/limits.conf
# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.

No comments:

Post a Comment