Accidentally, Port 22 got closed. I cannot ssh into the instance, though the instance are running well on other desired ports. Getting following error while doing SSH.
ssh: connect to host X.X.X.X port 22: Connection refused
I restarted the instance, but still ssh is not working.
The security groups are open for port 22 from anywhere(0.0.0.0/0).
I was trying to set the default welcome message after SSH on the machine by editing /etc/ssh/sshd_config file. Just after editing and reloading the ssh with the following command I was unable to ssh again.
sudo service ssh reload
