Basic SSH port change not working on EC2 instance
Solution 1:
It may be a typo, but if you want to change the port that sshd listens on, you need to edit the Port
setting in /etc/ssh/sshd_config
, not ssh_config
.
Also, you're using two different port numbers above (2345 and 2232), but I'm sure that's a typo.
If it's not that, could you edit into your question the output of iptables -L -n -v
so we can see your firewall rules?
Solution 2:
ssh_config
is the SSH client configuration file.
sshd_config
is the SSH daemon (server) configuration file.
So, if you want to change the port for the ssh server You have to edit the sshd_config
file,
Uncomment the line
Port 22
and change port 22 to 2345.
After editing the file, restart the ssh service.
/etc/init.d/sshd restart
And also allow ssh port in the iptables. and restart the iptables.