Problems with remote login with ssh and limits.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to get /etc/security/limits.conf to work correctly for remote logins as well as local su.

Here is what I mean...

This does not work
------
root@cots ~# ssh tmartin@cots
tmartin@cots's password:
UCSD Physics Server
Unauthorized Access is Prohibited


tmartin@cots ~$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 7168 virtual memory (kbytes, -v) unlimited tmartin@cots ~$ ulimit -n 4096 -bash: ulimit: open files: cannot modify limit: Operation not permitted tmartin@cots ~$ -------

This does work
-------
root@cots ~# su - tmartin
tmartin@cots ~$ ulimit -a
core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 4096
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) 7168
virtual memory        (kbytes, -v) unlimited
tmartin@cots ~$ ulimit -n 4096
tmartin@cots ~$ ulimit -a
core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 4096
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) 7168
virtual memory        (kbytes, -v) unlimited
-------

Here is my /etc/security/limits.conf

...stuff removed for brevity...
#ftp             hard    nproc           0
#@student        -       maxlogins       4
*               hard    nofile            4096
*               soft    nofile            4096
...stuff removed for brevity...

Here is my /etc/pam.d/sshd file
#%PAM-1.0
auth       required     pam_stack.so service=system-auth
auth       required     pam_nologin.so
account    required     pam_stack.so service=system-auth
password   required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth
session    required     pam_limits.so
session    optional     pam_console.so

I have tried this on both a redhat 8 and 9 box. Why does one work and the other not??? I want users to be able to specify the number of max open files they can have from remote (within reason). I also want them to log in via ssh.

Is there something else I need to set? Is it the remote login or is it sshd?

Thanks for any insight

Terrence Martin
UCSD Physics




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

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux