ssh server connect to host xxx port 22: Connection

2019-01-26 12:25发布

问题:

I am trying to connect to remote server via ssh but getting connection timeout.

I ran the following command

ssh testkamer@test.dommainname.com

and getting following result

ssh: connect to host testkamer@test.dommainname.com port 22: Connection timed out

but if try to connect on another remote server then I can login successfully.

So I think there is no problem in ssh and other person try to login with same login and password he can successfully login to server.

Please help me
Thanks.

回答1:

Here are a couple of things that could be preventing you from connecting to your Linode instance:

  1. DNS problem: if the computer that you're using to connect to your remote server isn't resolving test.kameronderdehamer.nl properly then you won't be able to reach your host. Try to connect using the public IP address assigned to your Linode and see if it works (e.g. ssh user@123.123.123.123). If you can connect using the public IP but not using the hostname that would confirm that you're having some problem with domain name resolution.

  2. Network issues: there might be some network issues preventing you from establishing a connection to your server. For example, there may be a misconfigured router in the path between you and your host, or you may be experiencing packet loss. While this is not frequent, it has happenned to me several times with Linode and can be very annoying. It could be a good idea to check this just in case. You can have a look at Diagnosing network issues with MTR (from the Linode library).



回答2:

I got this error and found that I don't have my SSH port (non standard number) whitelisted in config server firewall.



回答3:

There can be many possible reasons for this failure.

Some are listed above. I faced the same issue, it is very hard to find the root cause of the failure.

I will recommend you to check the session timeout for shh from ssh_config file. Try to increase the session timeout and see if it fails again



回答4:

If you are on Public Network, Firewall will block all incoming connections by default. check your firewall settings or use private network to SSL