# PAM, limits and SSH

## Kintaro_Oe

I have the following problem. I try to set the open files limit to more then 1024. For this I use the /etc/security/limits.conf and add the line

* - nofile 4096

Well, this works fine if I login on the maschine itself (maximum open files is set to 4096) but not if I login from a remote host per SSH (defaults back to 1024 open files).

Any ideas how to get the limit of 1024 open files up to 4096 per SSH?

I need this for a normal user, not superuser (root).

----------

## c00ld00d

Is your ssh PAM-enabled? anyway, PAM sucks, and you suck too, because you use it.

----------

## Kintaro_Oe

Nice style kiddie! *megivesyousomesweets*

Well, another idea from a more friendly dude out there to get limits to work (with or without PAM)?

----------

## psp

Hmmm... I would try (but don't have the time) adding:

session    required    /lib/security/pam_limits.so

to my /etc/pam.d/sshd file.

Hope this helps (and works)

----------

## Kintaro_Oe

I tried this already, but it doesn't seem to work. :-/

----------

## EPrime

With luck this post http://www.dfdtech.net/linux/security/userlimits/ might be able to help.

----------

## Kintaro_Oe

Read it, Tried it. Not working. Looks like a bug to me. PAM bug or Gentoo's way of using PAM?

Yes, i have tried every single way of getting limits to work with a login per ssh. 

No, /etc/profiles is no help here.  :Wink: 

----------

