[CentOS] sshd: listen on ip1:port1 and ip2:port2

Tue Jan 24 12:44:39 UTC 2012
Fabien Archambault <fabien.archambault at univ-amu.fr>

2012/1/24 Alexander Farber <alexander.farber at gmail.com>

> Hello,
>
> with CentOS 6.2 - is it possible to configure OpenSSH
> daemon to listen on different IPs _and_ ports?
>
> I have received a 2nd IP address for my server
> and have successfully configured by adding the new
> "/etc/sysconfig/network-scripts/ifcfg-eth0:1" file.
>
> I'd like SSHd to keep listening at the_old_ip:22
> but also at the_new_ip:443.
>
> The 443 on the_old_ip is already taken by Apache,
> so I can't just write "Port 22" + "Port 443" to sshd_config.
>
> Thank you
> Alex
>
> Hi,

In order to do so, you just need to add in /etc/ssh/sshd_config:
Port 22
Port 443

Then reload the ssh service.

Fabien