Various values ​​returned by ulimit -r

I added the following two lines to my system-wide /etc/security/limits.conf:

*       soft    rtprio      55
*       hard    rtprio      55

After rebooting the system, I get two different results, depending on how I access my user account on the machine.

user@client# ssh user@server

user@server# ulimit -r
55

Then I log out and log back in as root

user@client# ssh root@server

root@server# su - user
user@server# ulimit -r
0

I have no special settings in either .bashrc or elsewhere, or at least I think so.

Why is this happening?

+5
source share
1 answer

You should look at the configuration of PAM sshand su. I believe that they are not the same.

For example, on my system:

$ grep limit /etc/pam.d/su
# Sets up user limits, please uncomment and read /etc/security/limits.conf
# (Replaces the use of /etc/limits in old login)
# session    required   pam_limits.so

$ grep limit /etc/pam.d/sshd
# access limits that are hard to express in sshd_config.
# Set up user limits from /etc/security/limits.conf.
session    required     pam_limits.so

, pam_limits. , - .

+5

All Articles