Short answer: this is working as intended - manual steps are needed to make this work.
This isn’t a bug. By default
pam_limits isn’t enabled for console logins and several other ways to switch user.
I’ve researched several other distributions and I don’t see this done differently in other distro’s (maybe there are some, but it appears at least that this isn’t standard).
The reason is
pam_limits isn’t included in
common-auth pam files. You can still manually set this up:
su and maybe others from
- Modify it and add
session required pam_limits.so to the relevant ones
- create your
/etc/security/limits.conf file as needed