LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-16-2009, 07:38 AM   #1
r3z
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
pam_listfile to limit users domain users SSH access


Problem:
Any domain user can log in to my linux servers if I join them to the domain.
Solution:
Use pam_listfile to limit it to one specific group.
Followed this guide http://www.cyberciti.biz/tips/howto-...oup-login.html
Result: Will not work! :-p

Put the following line in my /etc/pam.d/system-auth file:
auth required /lib/security/$ISA/pam_listfile.so onerr=fail item=group sense=allow file=/etc/login.group.allowed

Added the correct AD group to the login.group.allowed file and no worky..
I cannot log in to the server with a domain user in that group. If I remove that line and\or change item=group to user and add my test user id to it it works fine.

messages shows this:
Sep 14 16:23:26 servername sshd[17839]: PAM-listfile: Refused user testid for service sshd
Sep 14 16:23:26 servername sshd(pam_unix)[17839]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.1.1.1 user=testid
Sep 14 16:23:26 servername sshd[17839]: pam_winbind(sshd): user 'testid' granted access


Any ideas would be GREATLY appreciated.. I am banging my head on the wall on this one and it is probably something stupid I am just overlooking.
Thanks

r3z
 
Old 09-17-2009, 07:25 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you seem to be reinventing the wheel a little. Why not just use /etc/security/access.conf? Or if you want an SSH only solution, set "AllowGroups mygroup" in your /etc/ssh/sshd_config file.
 
Old 09-18-2009, 06:44 AM   #3
r3z
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
you seem to be reinventing the wheel a little. Why not just use /etc/security/access.conf? Or if you want an SSH only solution, set "AllowGroups mygroup" in your /etc/ssh/sshd_config file.
Used the /etc/ssh/sshd_config AllowGroups option and that did the trick!

Thanks!
 
Old 09-18-2009, 01:13 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Personally I don't like that solution, as it's not generic, but it is *very* simple and reliable...
 
Old 09-18-2009, 11:09 PM   #5
r3z
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Original Poster
Rep: Reputation: 0
If you have a better solution I am all ears..
 
Old 09-19-2009, 01:25 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well as above, i'd prefer using access.conf
 
  


Reply



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
Using pam_listfile.so to limit SSH access in RHEL 5 vicjalan Linux - Enterprise 6 11-04-2010 03:32 PM
When using ssh: limit the number of users, that can log on, per IP address -rate tuxhats Linux - Security 24 04-17-2009 03:23 AM
SSH access problems: Can only allow users SSH access by adding to root group dhupke Slackware 10 12-21-2008 09:48 AM
samba on fc9, how to limit access to users joemarceo Linux - Newbie 2 10-08-2008 02:20 AM
Data Access Limit to Users Gaurav Wadhwa Linux - Enterprise 6 02-28-2005 03:15 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 09:25 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