LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-12-2007, 03:35 AM   #1
livetoday
Member
 
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106

Rep: Reputation: 15
Unable to restrict SSH sessions through PAM


OS: RHEL 3 kernel: 2.4.21-47.ELsmp

_______________________________
cat /etc/security/limits.conf

sunil hard maxlogins 1
-------------------------

cat /etc/pam.d/sshd

session required pam_limits.so
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 optional pam_console.so

_______________________________

tail /var/log/messages

Apr 12 13:51:39 estel sshd(pam_unix)[7735]: session opened for user sunil by (uid=0)
Apr 12 13:51:47 estel sshd(pam_unix)[7781]: session opened for user sunil by (uid=0)
Apr 12 13:51:58 estel pam_limits[7827]: Too many logins (max 1) for sunil


now the user sunil should not be able to ssh only once. However, here he is able to create two ssh sessions. What are the things I need to do.

PS: When I use "sunil hard maxlogins 0". It works perfectly fine.means no login ....
 
Old 04-12-2007, 01:18 PM   #2
cgjones
Member
 
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
Check out this link to the Red Hat Knowledgebase. There is only one difference, so I'm not sure if this will help at all.

What version of OpenSSH are you running?
 
Old 04-13-2007, 01:50 AM   #3
livetoday
Member
 
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106

Original Poster
Rep: Reputation: 15
even putting an " - " in place of " hard" does not make any difference..

openssh version is openssh-3.6.1p2-33.30.9

Quote:
Originally Posted by cgjones
Check out this link to the Red Hat Knowledgebase. There is only one difference, so I'm not sure if this will help at all.

What version of OpenSSH are you running?
 
Old 04-13-2007, 01:46 PM   #4
cgjones
Member
 
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
I asked about the version because while I was searching the Red Hat knowledgebase, I came upon the following FAQ.

http://kbase.redhat.com/faq/FAQ_45_3504.shtm

At the bottom, they say:
Quote:
Note: This problem has been fixed in version 3.8 of SSH which may be included in future releases of Red Hat Enterprise Linux.
I would assume that this is the problem you are running into.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to restrict the localuser dshafi Linux - Security 3 03-31-2006 04:18 AM
restrict/allow ssh users mike30188 Linux - Security 2 06-20-2005 08:37 PM
Restrict ssh/sftp with chroot? Chowroc Linux - Networking 4 01-25-2005 10:48 AM
How do I restrict ssh access to certain ip addresses? 360 Linux - Networking 5 04-05-2002 08:04 AM
What is the best way to restrict ssh access for RH7 360 Linux - Security 1 12-01-2001 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration