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
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.How about using iptables to forward 443 to 22? I think it is the simplest way to do this hack. -- Eero
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
On 24.01.2012, at 13:23, Alexander Farber wrote:> I'd like SSHd to keep listening at the_old_ip:22 but also at the_new_ip:443.# man sshd_config: ListenAddress Specifies the local addresses sshd should listen on. The following forms may be used: ListenAddress host|IPv4_addr|IPv6_addr ListenAddress host|IPv4_addr:port ListenAddress [host|IPv6_addr]:port If port is not specified, sshd will listen on the address and all prior Port options specified. The default is to listen on all local addresses. Multiple ListenAddress options are permitted. Addition- ally, any Port options must precede this option for non port qualified addresses. # grep ListenAddress /etc/sshd/sshd_config: ListenAddress 127.0.0.1:443 ListenAddress 192.168.42.182:22 # netstat -antup | grep sshd tcp 0 0 192.168.42.182:22 0.0.0.0:* LISTEN 31585/sshd tcp 0 0 127.0.0.1:443 0.0.0.0:* LISTEN 31585/sshd Best regards, Peter.
Maybe Matching Threads
- [Bug 1439] New: Atomically updating/reloading a large set with nft -f is excessively slow
- OT: closing a port on home router
- [Bug 1188] New: nft fails to parse own output; unable to save-restore active state
- [PATCH] display ipv6 address in networking details page, also fix ipv6 netmask configurations.
- [PATCH] display ipv6 address in networking details page, also fix ipv6 netmask configurations