LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Limiting user SSH Connections (https://www.linuxquestions.org/questions/linux-security-4/limiting-user-ssh-connections-607578/)

bzfxn6 12-18-2007 05:53 AM

Limiting user SSH Connections
 
I am looking to lock down how many active connections a user can have on ssh.

I did think I can just make an entry in the limits.conf file, and then change the pam conf for sshd. But for some reason it did not work.

If anyone has done this before can they point out my mistake.

Redhat version

cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

limits.conf

tail limits.conf
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4

* - maxlogins 3
# End of file

pam sshd

cat /etc/pam.d/sshd
#%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_loginuid.so
session required pam_limits.so

ramram29 12-18-2007 09:43 AM

You can do that through pam.

bzfxn6 12-20-2007 07:02 AM

Any surgestions on what I need to do to the PAM conf to make it work.

I have logged a call with Redhat, but I have not had a reply back now for a few days.


All times are GMT -5. The time now is 07:14 PM.