What is login class in bsd?

Login classes has been a part of FreeBSD for as long I can remember. It allows the system administrator (root) to set resource constraints for users, or a group of users as configured in /etc/login.conf.

This is particularly useful on multi-user servers such as webhosting and shell providers.

These kind of constraints involves:

  • CPU utilization
  • Memory utilization
  • Maximum open files (file descriptors)
  • Biggest individual file allowed to create within that login class (not redundant to quotas).
  • And a lot more.

In case you make any tweaks, or add new login classes you have to use cap_mkdb to generate a capability database from /etc/login.conf.

Apply changes: cap_mkdb /etc/login.conf


Think cgroups. Also, you might find "ps auxw -o class" useful, to see what processes belong to which class, and "su -c classname", to change your login class for testing purposes.

Tags:

Freebsd

Bsd