Setup SSHD with multiple ports / iptables / selinux

Today i introduced AWS to a friend and there where some trouble setting up sshd to listen on multiple ports. First of all make sure your AWS Security Group also contain the additional ports that you want to use. Then follow those steps:

add ports to sshd :
vi /etc/ssh/sshd_config
Port 443
Port 80

modify selinux configuration to actually allow this to work :
yum install provides /usr/sbin/semanage
semanage port -m -t ssh_port_t -p tcp 443
semanage port -m -t ssh_port_t -p tcp 80
service sshd restart

add the ports to iptables configuration :
vi /etc/sysconfig/iptables
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 443 -j ACCEPT
service iptables restart

If this should not work for you just drop me a comment and i try to help ya.


More Reading
Newer// Services
comments powered by Disqus