5

Possible Duplicate:
Allow SSH only on one of a servers IP addresses

I have two IP addresses, IP1 and IP2. Currently I have set sshd to listen on port 22 and port 443. The problem is that it listens on both these ports on both IP addresses. Is it possible to listen just on port 22 on IP1 and listen on both port 22 and 443 on IP2? If so, how?

I am running Ubuntu 10.04 server.

Thanks,

1
  • I don't really think this is a duplicate. The other one is a little bit different question. Aug 12, 2013 at 20:47

1 Answer 1

9

Yes:

ListenAddress ip.the.first:22
ListenAddress ip.the.second:22
ListenAddress ip.the.second:443

Those ListenAddress directives are in your sshd_config file. It does accept IP:Port nomenclature to specify exactly where to listen. if you do this, you won't need the Ports directive.