0

settting up an ssh connection to vm is taking so much time. I have created a ssh key using ssh keygen and added the host ip address to my config file. Deleted the knownhosts file from .ssh folder. Still getting connection timed out. Need help asap

Comments
  • 3
    WELL GO FIX IT!
    Time is running out!
  • 0
    @bagfox thanks! Needed that
  • 2
    I believe it's called... get a better internet connection.

    Or alternatively

    ClientAliveInterval 1200
    ClientAliveCountMax 5

    Bastard won't timeout anytime soon.
  • 0
    SSH keys should be independent of connection timeouts...
    Have you tested TCP connection works ("telnet <IP> <SSH port>" should result in "SSH-2.0-OpenSSH_X.Y")?
  • 0
    Your firewall is blocking the port.

    Configure both host and vm firewalls accordingly.

    Conn timeout is not thrown when your access policy doesn't match. It's thrown when some network connection is timing out. If the firewall is dropping packets rather than rejecting - that's exactly what you get.
  • 0
    I thought of that and I tried
    sudo ufw allow ssh
    Still facing the same issue
  • 2
    @ashishsalunkhe probe the port manually to eliminate firewall as the culprit.

    In your host:

    nc -w3 -vz <vm_IP> 22

    and see whether you get a success message or a timeout. If it's a timeout - it's definitely not your ssh configuration to blame but networking
  • 1
    @netikras I got it succeeeded
  • 0
Add Comment