1829620 Members
2349 Online
109992 Solutions
New Discussion

ulimit

 
Tonatiuh
Super Advisor

ulimit

Red Hat Enterprise Linux 3.0 for x86.

I want to set "ulimit -u 16384 -n 16384" from a non root (oracle) session.

I have modified the following:

vi /etc/profile
...
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 16384
else
ulimit -u 16384 -n 16384
fi
fi
...

vi /etc/security/limits.conf
...
* soft nproc 2047
* hard nproc 16384
* soft nofile 2048
* hard nofile 16384
...

vi /etc/pam.d/login
...
session required /lib/security/pam_limits.so

The Behavior is the this:

A) When I open a root session and switch (su) to user oracle, there is no problem and the "ulimit -a" shows the correct values.

B) When I open a session directly with oracle (not first with root) I get the following error message at login time:

-bash: ulimit: max user processes: cannot modify limit: Operation not permitted

The same error retunrs if I try to set manually the "ulimit -u 16384 -n 16384".

Any idea about this problem?
3 REPLIES 3
Ivan Ferreira
Honored Contributor

Re: ulimit

Only a user with superuser privileges may increase the ulimit.

If you defined the limits in /etc/security/limits.conf, those limits should be available to users, they don't need to run the ulimit command. The ulimit command in the profile is not necessary.

If you are logging in through SSH, set:

UsePrivilegeSeparation no

in /etc/ssh/sshd_config
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Tonatiuh
Super Advisor

Re: ulimit

The "ulimit" in the profile is just to set the limits automatically at opening session.

And yes, you are right; I am openin my session through ssh. I have set the "UsePrivilegeSeparation no" in /etc/ssh/sshd_config but the error message is still present.
Ivan Ferreira
Honored Contributor

Re: ulimit

Remove the commands from the profile and restart the sshd service.

service sshd restart.

As I said, only root can raise the ulimit parameters, so this won't work on other users.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?