ulimit -r 返回的不同值 [英] Different values returned by ulimit -r
问题描述
我在系统范围的/etc/security/limits.conf 中添加了以下两行:
I added to my system-wide /etc/security/limits.conf the following two rows:
* soft rtprio 55
* hard rtprio 55
系统重启后,根据我在机器上访问我的用户帐户的方式,我得到两种不同的结果.
After a system reboot, I get two different results according to the way I access my user account on the machine.
user@client# ssh user@server
user@server# ulimit -r
55
然后我注销并以root身份重新登录
Then I logout and login again as root
user@client# ssh root@server
root@server# su - user
user@server# ulimit -r
0
我在 .bashrc 和其他任何地方都没有特殊设置,至少我认为是.
I have no special settings neither in .bashrc nor in any other places, or, at least, I think so.
为什么会这样?
推荐答案
一定要看ssh
和su
的PAM配置.我想它们不一样.
You must look at the PAM configuration of ssh
and su
. I suppose that they are not the same.
例如在我的系统中:
$ 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
行被注释.我想你也有这样的事情.
As you can see in one of the cases the pam_limits
line is commented. I suppose that you have something like this also.
这篇关于ulimit -r 返回的不同值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!