Cannot connect to remote SSH

Omid Shojaee 121 Reputation points
2021-12-24T18:58:01.033+00:00

I'm unable to connect to my droplet on DigitalOcean with built-in SSH client of Windows 10.

To isolate the issue I tried other SSH clients:

  • Putty: connects without issue
  • Solar-Putty: connects without issue
  • PyCharm: although this is not an SSH client it has built-in SSH connection capabilities and works without issue.

So this is not related to firewall or antivirus.

When I try to connect, nothing happens after entering the command. The cursor blinks forever.

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. MotoX80 36,401 Reputation points
    2021-12-24T21:08:24.063+00:00

    Use the -vvv switch to have it display debug output.

    C:\>ssh -vvv microsoft.com
    OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
    debug3: Failed to open file:C:/Users/Dave/.ssh/config error:2
    debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
    debug2: resolving "microsoft.com" port 22
    debug2: ssh_connect_direct
    debug1: Connecting to microsoft.com [104.215.148.63] port 22.
    debug3: finish_connect - ERROR: async io completed with error: 10060, io:000002517DC375A0
    debug1: connect to address 104.215.148.63 port 22: Connection timed out
    debug1: Connecting to microsoft.com [40.76.4.15] port 22.
    debug3: finish_connect - ERROR: async io completed with error: 10060, io:000002517DC375A0
    debug1: connect to address 40.76.4.15 port 22: Connection timed out
    debug1: Connecting to microsoft.com [40.112.72.205] port 22.
    
    1 person found this answer helpful.

  2. xdawn97 1 Reputation point
    2021-12-26T07:19:13.553+00:00

    Which authorizing method do you use?
    In the log file, it seems that the openssh client do not have access to path 'C:/Users/omids/.ssh/id_rsa-cert',and can not access 'C:/ProgramData/ssh/ssh_known_hosts' either. So, please check weither the process have the right permission to read/write to those paths.

    0 comments No comments

  3. Omid Shojaee 121 Reputation points
    2021-12-26T18:26:21.787+00:00

    @xdawn97

    Thanks.

    I use public key method. The following files are in 'C:\Users\omids.ssh' folder:

    config  
    id_rsa  
    id_rsa.pub  
    known_hosts  
    

    id_rsa and id_rsa.pub are generated by ssh-keygen command of Windows 10 (the same machine).

    0 comments No comments

  4. Omid Shojaee 121 Reputation points
    2021-12-30T11:13:45.817+00:00

    @Limitless Technology

    If you look at my original question and my reply to MotoX80 it's clear that I know how to install it, it is already installed, and I know how to use it.


  5. Omid Shojaee 121 Reputation points
    2021-12-25T19:19:00.973+00:00

    @MotoX80

    Thanks. Here's the result. After last line nothing happens until I press CTRL+C. However as I mentioned, other SSH clients connect without any issue.

    C:\Users\omids>ssh -vvv ******@webserver.omidshojaee.com  
    OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2  
    debug1: Reading configuration data C:\\Users\\omids/.ssh/config  
    debug1: C:\\Users\\omids/.ssh/config line 1: Applying options for webserver.omidshojaee.com  
    debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2  
    debug2: resolving "webserver.omidshojaee.com" port 22  
    debug2: ssh_connect_direct  
    debug1: Connecting to webserver.omidshojaee.com [207.154.200.176] port 22.  
    debug1: Connection established.  
    debug1: identity file C:\\Users\\omids/.ssh/id_rsa type 0  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_rsa-cert error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_rsa-cert.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_rsa-cert type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_dsa error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_dsa.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_dsa type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_dsa-cert error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_dsa-cert.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_dsa-cert type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ecdsa error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ecdsa.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_ecdsa type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ecdsa-cert error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ecdsa-cert.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_ecdsa-cert type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ed25519 error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ed25519.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_ed25519 type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ed25519-cert error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_ed25519-cert.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_ed25519-cert type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_xmss error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_xmss.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_xmss type -1  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_xmss-cert error:2  
    debug3: Failed to open file:C:/Users/omids/.ssh/id_xmss-cert.pub error:2  
    debug1: identity file C:\\Users\\omids/.ssh/id_xmss-cert type -1  
    debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1  
    debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.3  
    debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000  
    debug2: fd 3 setting O_NONBLOCK  
    debug1: Authenticating to webserver.omidshojaee.com:22 as 'omid'  
    debug3: hostkeys_foreach: reading file "C:\\Users\\omids/.ssh/known_hosts"  
    debug3: record_hostkey: found key type ECDSA in file C:\\Users\\omids/.ssh/known_hosts:1  
    debug3: load_hostkeys: loaded 1 keys from webserver.omidshojaee.com  
    debug3: Failed to open file:C:/Users/omids/.ssh/known_hosts2 error:2  
    debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2  
    debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2  
    debug3: order_hostkeyalgs: prefer hostkeyalgs: ******@openssh.com,******@openssh.com,******@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521  
    debug3: send packet: type 20  
    debug1: SSH2_MSG_KEXINIT sent  
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.