Limits of PAM

Let's stick with using the SSH login at the moment. Many users will only access the server via SSH, perhaps using the PuTTY SSH client on Windows. If we want to control access to system resources, then we can implement restrictions using PAM and pam_limits.so. We should add the following line to the /etc/pam.d/sshd file:

session required pam_limits.so

This will implement the module, however, we still have to set the restrictions in the /etc/security/limits.conf file; the module reads from this file. The file's structure is set as follows with these elements making up a line in the limits file:

<domain> <type> <item> <value>

Domain

Domain represents to whom the limit is intended. This, most often, is a username such as user1 or a group ...

Get CentOS System Administration Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.