{ 11 comments… read them below or add one }

1 nick June 5, 2007

This works great on local users it seems, but its not having any effect on ldap users, or groups, what would you suggest as a way to control their access?

Reply

2 vivek June 5, 2007

It should work, you need to play with pam modules. Pam is designed for this kind of work only.

Reply

3 Gerald August 28, 2009

Hi,
If you want block all ssh access (via login/password) AND vi authorized_keys, you shoud use ‘account required pam_listfile.so item=user sense=allow file=/etc/ssh/sshd.allow onerr=succeed’

because ‘auth xxx’ line seems not checked if sshd use public keys authentification.

Bst Regard
GeraldH

Reply

4 Bhagesh September 2, 2009

It is working fine for ssh and scp.
Now I wants to block only the ssh login session. and I required the scp file transfer
anybody have an Idea

Reply

5 Chuck Hale December 22, 2009

Article solved my problem!

Reply

6 Kevin December 30, 2009

In my experience, the line:
auth required pam_listfile.so item=user sense=allow file=/etc/sshd/sshd.allow onerr=fail

must be prepended (i.e., placed as the first line) in the file, not appended as this article states.

Reply

7 vimbyseno March 16, 2010

my config:
auth required /lib/security/pam_listfile.so item=user sense=allow file=/etc/sshd/user-sshd onerr=fail

user in user-sshd:
root
user1
user2
……

now root can’t remote the vps :(
if i login as root using putty, the console window (putty) closed immedietly when root loged to vps :(
how to solve my problem??? plis help me

Reply

8 Rajesh March 29, 2010

boot from a rescue cd and edit the files.

Reply

9 Gerrard Geldenhuis May 13, 2010

As stated above it is key to prepend the line to allow it to be executed by pam. There is also no need at all to restart sshd.

Reply

10 suzuki October 2, 2010

hi,

it doesn’t work for my system. why?

Reply

11 mark December 14, 2011

It’s not working on openldap authentication with white list on /etc/ssh/ssh.allow.

Dec 14 18:47:11 PDCSERVER slapd[21346]: conn=64795871 op=1 SRCH base=”ou=Users,dc=kama,dc=in” scope=1 deref=0 filter=”(&(objectClass=shadowAccount)(uid=rana.taba))”

Dec 14 18:47:11 showa9 sshd[22655]: error: PAM: Authentication failure for rana.taba from 192.168.100.200

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">




Previous post:

Next post: