optimization

How to run another SSH daemon on Amazon EC2 - on a different port

  • Posted on: 31 October 2014
  • By: Michał Turecki

Running a separate SSH server only makes sense when a second SSHD will run using different settings. If settings are the same, port forwarding should be enough to just pass the traffic from one port to another:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 20202 -j REDIRECT --to-port 22

where 20202 is the new port and 22 is the default SSH port.

If SSHD settings should be separate, we need another sshd instance with a copy of current configuration files).

Please remember to change the alternative ssh port number (20202) to a custom port.