MASIGNASUKAv102
6510051498749449419

Restricting Users with ulimit in linux.

Restricting Users with ulimit in linux.
Add Comments
Monday, October 23, 2017




Oneway to limit users is by using the ulimit command that is part of the shell.
Typically ulimit commands are placed in /etc/profile so that each user who logsin will execute the commands and set limits on himself. Therefore decide what limits to place on your users and put ulimit commands into /etc/profile.

The most ulimit options are...


  1. -a    Displays all limits 
  2. -c     maximum core file size
  3. -f      maximum file size
  4. -t      maximum CPU time in sec
  5. -n    maximum no of open files
  6. -u    maximum no of processes
-v    maximum amount of virtual memory



This example displays the users limit and then changes the maximum number of open files..

Gspace$ ulimit -a |grep open


    
Adarshreddy Adelli

As an Engineering Lead with deep expertise in Artificial Intelligence, Cybersecurity, and Systems Architecture, I guide teams in building innovative, secure, and scalable solutions.I am passionate about tackling challenging technical problems, fostering engineering excellence, and delivering solutions that balance innovation, security, and performance. I actively share knowledge through blogging and community engagement, contributing to the advancement of AI and cybersecurity practices.