I am trying to connect to remote server via ssh but getting connection timeout.
I ran the following command
ssh testkamer@test.dommainname.com
I got this error and found that I don't have my SSH port (non standard number) whitelisted in config server firewall.
Update the security group of that instance. Your local IP must have updated. Every time it’s IP flips. You will have to go update the Security group.
That error message means the server to which you are connecting does not reply to SSH connection attempts on port 22. There are three possible reasons for that:
2.You are running an SSH server on that machine, but on a different port. You need to figure out on which port it is running; say it's on port 1234, you then run ssh -p 1234 hostname.
EDIT: as (correctly) pointed out in the comments, the third is certainly the case; the other two would result in the server sending a TCP "reset" package back upon the client's connection attempt, resulting in a "connection refused" error message, rather than the timeout you're getting. The other two might also be the case, but you need to fix the third first before you can move on.
The possibility could be, the SSH might not be enabled on your server/system.
sudo apt update
sudo apt install openssh-server
Now try to access the server/system with following command
ssh username@ip_address