Re: Enable SSH on this IP Address

Vm <vijaymajagaonkar@xxxxxxxxx> writes:

On May 25, 1:25 pm, MrD <mrdemean...@xxxxxxxxxxxxxxx> wrote:
Regis wrote:
Vm <vijaymajagaon...@xxxxxxxxx> writes:

Hi all,

I need to restrict ssh connection on to particular ip address, What
 i mean to say is only allowed ip address can ssh to my linux box i
m running CentOS 5.4, I have looked into /etc/hosts but it don't
really help me.

man sshd_config

ListenAddress may be what you want.

ListenAddress specifies which local address sshd listens on, not which
remote address is permitted to connect. There's no config setting that
controls what the OP wants, as far as I can see. You can use TCP
Wrappers to do this, though.


Thanks for the help.

MrD did a better job of divining your question than I did. :-)

Indeed, tcpwrappers /etc/hosts.allow /etc/hosts.deny and the like with
sshd directives would be the way to control if client IP address
filtering for sshd is what you're looking for.

man hosts_access

in /etc/hosts.deny you may want to deny everything not explicitly allowed:

in /etc/hosts.allow you may want (where ip1/ip2 are ip addresses you wish )
sshd: ip1
sshd: ip2