[TriLUG] how do I limit log on off Id to thre IP address

Jon Carnes jonc at nc.rr.com
Wed Feb 11 08:56:21 EST 2004


On Wed, 2004-02-11 at 02:13, Greg Cox wrote:
> > I am running an linux server, and I want to limit a logon  id to
> > three ip address. is there any way to do this with sshd?
> 
> pam's pam_access module will do it.
> 
> assuming a RH system...
> 
> Create /etc/security/sshd_access.conf
> ------
> -:dude:ALL EXCEPT 192.168.12.2 192.168.12.6 192.168.12.9
> +:ALL:ALL
> ------
> 
> Then add it to /etc/pam.d/sshd:
> account    required     pam_access.so accessfile=/etc/security/sshd_access.conf

Hmmm, very elegant... I just love PAM!

I would go with defining the three addresses (and their keys) in:
  $HOME/.ssh/authorized_keys

http://www.die.net/doc/linux/man/man8/sshd.8.html

Good Luck




More information about the TriLUG mailing list