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.


marked as duplicate by Jeff Ferland, EEAA, John Gardeniers, mulaz, Ward Oct 29 '12 at 13:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from stackoverflow.com Oct 6 '10 at 0:20

This question came from our site for professional and enthusiast programmers.

  • I don't really think this is a duplicate. The other one is a little bit different question. – Rudy Matela Aug 12 '13 at 20:47


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.