windowssshwindows-subsystem-for-android

kex_exchange_identification: read: Connection reset in windows, but working fine on WSA


I cannot connect to my server via ssh using my windows 11 & institute wfi, but I can connect to this server via my cell phone network on the same laptop. My institute has blocked Port 22, so I've enabled my remote server to listen to Port 443.

Here is the output of ssh xxxx@x.xxx.xxx.xxx -p 443 -vvv

OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
debug1: Reading configuration data C:\\Users\\M Quamer Nasim/.ssh/config
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolve_canonicalize: hostname x.xxx.xxx.xxx is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> 'C:\\Users\\M Quamer Nasim/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> 'C:\\Users\\M Quamer Nasim/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to x.xxx.xxx.xxx [x.xxx.xxx.xxx] port 443.
debug1: Connection established.
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_rsa error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_rsa.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_rsa error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_rsa type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_rsa-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_rsa-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_rsa-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_rsa-cert type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_dsa error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_dsa.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_dsa error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_dsa type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_dsa-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_dsa-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_dsa-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_dsa-cert type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ecdsa type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ecdsa-cert type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa_sk error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa_sk.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa_sk error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ecdsa_sk type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa_sk-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa_sk-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ecdsa_sk-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ecdsa_sk-cert type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519 error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519 error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ed25519 type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ed25519-cert type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519_sk error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519_sk.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519_sk error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ed25519_sk type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519_sk-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519_sk-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_ed25519_sk-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_ed25519_sk-cert type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_xmss error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_xmss.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_xmss error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_xmss type -1
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_xmss-cert error:2
debug3: Failed to open file:C:/Users/M Quamer Nasim/.ssh/id_xmss-cert.pub error:2
debug3: failed to open file:C:/Users/M Quamer Nasim/.ssh/id_xmss-cert error:2
debug1: identity file C:\\Users\\M Quamer Nasim/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.6
debug3: recv - from CB(2) ERROR:108, io:000001B96A4D80F0
kex_exchange_identification: read: Connection reset
Connection reset by x.xxx.xxx.xxx port 443

Please help, I can't even get it working with VPN

An interesting thing to note is that I'm able to login to this server using Windows Subsystem for Android with the help of terminus app & a VPN. I'm using the exact same command as shared above, i.e., ssh xxxx@x.xxx.xxx.xxx -p 443

I don't understand why I am unable to ssh to the server using windows, not even with VPN, but can get it working on the same laptop via WSA + VPN using the same institute network.


Solution

  • Okay I finally figured out a workaround

    There is a high probability that the institute server has whitelisted only the in-house server, putting all other servers outside the institute on a blacklist and hence not able to ssh.

    There are two alternatives to this.

    1. You can use WSA in your Windows 11 with VPN and use port = 443, and it will work perfectly (tested already)

    2. You can also use vscode new feature called code-server, and this will let you log in to your server via a link provided by the command. All you need is to authenticate it via GitHub. One thing everyone should understand is you'll need to set up code-server on your remote server using your mobile data or using a network from which you can ssh. It's a one-time ssh setup, and then you can use it for as long as you want. This feature is present in insiders version of vscode and not it the stable version. Follow This link