System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

ulimit: open files: cannot modify limit: Operation not permitted

 
Carme Torca
Super Advisor

ulimit: open files: cannot modify limit: Operation not permitted

Hi,

I have one user USER1, and when I go into the system by ssh and do #ulimit -a (its has
open files (-n) 1024)
and if I do #ulimit -n 16384, its outs:

"ulimit: open files: cannot modify limit: Operation not permitted"

But if I enter by root and then su - USER1, its has (open files 16384, because I have one ulimit -n 16384 on the .bash_profile.

What is happenning?. How could I change this when I enter by ssh directly by the USER1??

Thanks a lot of,
Carmen.

Users are not too bad ;-)
3 REPLIES
Steven E. Protter
Exalted Contributor

Re: ulimit: open files: cannot modify limit: Operation not permitted

Shalom,

You may have a kernel limit interfering with your ulimit command.

You could try unlimited instead of a number.

You may want to check maxupcr and other kernel parameters that control file open.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor

Re: ulimit: open files: cannot modify limit: Operation not permitted

For each ulimit variable, there are actually two limits: a soft limit and a hard limit.

A normal user can adjust the soft limit freely in the range of 0....
A normal user can adjust the hard limit too, but can only decrease it. You must be root to increase the hard limit from its default value.

To see the hard limit values, run "ulimit -H -a".

The limit values are inherited from the parent process to the child process: you could add the command to increase the hard limit to the sshd startup script, so that sshd and all sessions started through it will inherit the increased hard limit. After that, you should be able to increase the soft limit as a normal user.

Alternatively, some Linux distributions have PAM modules (pam_limit.so) that can adjust the limit values at login time, if configured to do so.

MK
MK
Jeeshan
Honored Contributor

Re: ulimit: open files: cannot modify limit: Operation not permitted

Hi

Check the kernel parameter using command related to no. of open file max

#sysctl -a|grep fs.file-max

if the parameter is >= 16384 than you can set like this other wise you need to change the kernel parameter.
a warrior never quits