Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Red Hat Linux (http://www.linux-archive.org/red-hat-linux/)
-   -   ulimit error while changing max files to unlimited: PAM / sshd options? (http://www.linux-archive.org/red-hat-linux/418287-ulimit-error-while-changing-max-files-unlimited-pam-sshd-options.html)

Rahul Nabar 08-25-2010 07:29 PM

ulimit error while changing max files to unlimited: PAM / sshd options?
 
I tried changing the max limit on the number of open files but get an error:

ssh root@eu033
[root@eu033 ~]# ulimit -n unlimited
-bash: ulimit: open files: cannot modify limit: Operation not permitted

I verified that /etc/security/limits.conf has these two lines:
* hard nofile unlimited
* soft nofile unlimited

The default kernel limits seem high enough:
[root@eu033 ~]# cat /proc/sys/fs/file-max
1585781

[root@eu033 ~]# sysctl -a|grep fs.file-max
fs.file-max = 1585781

So why is my change via ulimit being rejected? What else could be
setting the limit at 1024. Any ideas how else I can get the file-limit
to be set to unlimited?

Actually, I am not even sure limits.conf is being used since I have
the following lines in the file /etc/ssh/sshd_config

UsePAM no
UsePrivilegeSeparation no

--
Rahul

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

"Carl T. Miller" 08-25-2010 09:19 PM

ulimit error while changing max files to unlimited: PAM / sshd options?
 
Yes, ulimit only lets you set a number up to the hard
limit that is set for your shell. Both hard and soft
limits are set to 1024 by default unless the limits.conf
file has been configured _before_ the shell is started.

I know this works with numbers, since I set hard and
soft limits to 10240 for select users. Try using a
number less than the total for the system instead of
unlimited.

c


Rahul Nabar wrote:
> I tried changing the max limit on the number of open files but get an
> error:
>
> ssh root@eu033
> [root@eu033 ~]# ulimit -n unlimited
> -bash: ulimit: open files: cannot modify limit: Operation not permitted
>
> I verified that /etc/security/limits.conf has these two lines:
> * hard nofile unlimited
> * soft nofile unlimited
>
> The default kernel limits seem high enough:
> [root@eu033 ~]# cat /proc/sys/fs/file-max
> 1585781
>
> [root@eu033 ~]# sysctl -a|grep fs.file-max
> fs.file-max = 1585781
>
> So why is my change via ulimit being rejected? What else could be
> setting the limit at 1024. Any ideas how else I can get the file-limit
> to be set to unlimited?
>
> Actually, I am not even sure limits.conf is being used since I have
> the following lines in the file /etc/ssh/sshd_config
>
> UsePAM no
> UsePrivilegeSeparation no
>
> --
> Rahul
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

Rahul Nabar 08-25-2010 09:29 PM

ulimit error while changing max files to unlimited: PAM / sshd options?
 
On Wed, Aug 25, 2010 at 4:19 PM, Carl T. Miller <carl@carltm.com> wrote:
> Yes, ulimit only lets you set a number up to the hard
> limit that is set for your shell. *Both hard and soft
> limits are set to 1024 by default unless the limits.conf
> file has been configured _before_ the shell is started.

I rebooted with the changed limits.conf. Doesn't that count as
"before" the shell is started?

> I know this works with numbers, since I set hard and
> soft limits to 10240 for select users. *Try using a
> number less than the total for the system instead of
> unlimited.

You are right! It does seem to work with arbitrarily large numbers
lower than the kernel limit. But not unlimited. Strange! Is that a
bug? I thought "unlimited" was supposed to be a convenient synonym for
the kernel imposed limit.

--
Rahul

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

"Carl T. Miller" 08-25-2010 10:00 PM

ulimit error while changing max files to unlimited: PAM / sshd options?
 
Rahul Nabar wrote:
> On Wed, Aug 25, 2010 at 4:19 PM, Carl T. Miller <carl@carltm.com> wrote:
>> Yes, ulimit only lets you set a number up to the hard
>> limit that is set for your shell. *Both hard and soft
>> limits are set to 1024 by default unless the limits.conf
>> file has been configured _before_ the shell is started.
>
> I rebooted with the changed limits.conf. Doesn't that count as
> "before" the shell is started?

Yes, absolutely. Of course a reboot isn't required if you're
changing user limits.

>> I know this works with numbers, since I set hard and
>> soft limits to 10240 for select users. *Try using a
>> number less than the total for the system instead of
>> unlimited.
>
> You are right! It does seem to work with arbitrarily large numbers
> lower than the kernel limit. But not unlimited. Strange! Is that a
> bug? I thought "unlimited" was supposed to be a convenient synonym for
> the kernel imposed limit.

I've never tried using unlimited. What you say makes sense.

c


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

Rahul Nabar 08-25-2010 10:08 PM

ulimit error while changing max files to unlimited: PAM / sshd options?
 
On Wed, Aug 25, 2010 at 5:00 PM, Carl T. Miller <carl@carltm.com> wrote:
>> You are right! It does seem to work with arbitrarily large numbers
>> lower than the kernel limit. But not unlimited. Strange! Is that a
>> bug? I thought "unlimited" was supposed to be a convenient synonym for
>> the kernel imposed limit.
>
> I've never tried using unlimited. *What you say makes sense.

I'll wait to see if any of the others on the list have a comment. Else
I'll file a bug report.

--
Rahul

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


All times are GMT. The time now is 04:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.