Diferentes valores devueltos por ulimit -r

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

Then I logout and login again as root

user@client# ssh root@server

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

I have no special settings neither in .bashrc nor in any other places, or, at least, I think so.

¿Por qué está pasando esto?

preguntado el 02 de julio de 12 a las 10:07

I think root has no such limitation and after su - user it inherits that value. -

Apparently, su - <user> gives <user> the environment limits setup of the calling bash. Since root is the only user which must be explicitly described in limits.conf for its limit values to be changed, becoming <user> from root gives always the wrong ulimit values. What I tried was to set a row for root like root - rtprio 55 and then the above commands gave the same result -

1 Respuestas

You must look at the PAM configuration of ssh y su. I suppose that they are not the same.

For example at 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

As you can see in one of the cases the pam_limits line is commented. I suppose that you have something like this also.

Respondido 03 Jul 12, 09:07

You were right: I fixed it and now it works as expected, thanks! - Blazor

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.