ssh server connect to host xxx port 22: Connection timed out on linux-ubuntu

前端 未结 10 1310
有刺的猬
有刺的猬 2020-12-17 20:04

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

I ran the following command

ssh testkamer@test.dommainname.com

相关标签:
10条回答
  • 2020-12-17 20:45

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

    0 讨论(0)
  • 2020-12-17 20:46

    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.

    0 讨论(0)
  • 2020-12-17 20:49

    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:

    1. You're not running an SSH server on the machine. You'll need to install it to be able to ssh to it.

    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.

    1. You are running an SSH server on that machine, and it does use the port on which you are trying to connect, but the machine has a firewall that does not allow you to connect to it. You'll need to figure out how to change the firewall, or maybe you need to ssh from a different host to be allowed in.

    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.

    0 讨论(0)
  • 2020-12-17 20:52

    The possibility could be, the SSH might not be enabled on your server/system.

    1. Check sudo systemctl status ssh is Active or not.
    2. If it's not active, try installing with the help of these commands

    sudo apt update

    sudo apt install openssh-server

    Now try to access the server/system with following command

    ssh username@ip_address

    0 讨论(0)
提交回复
热议问题