cant ssh to my service in certain network

Posted June 2, 2019 5.3k views
Linux BasicsArch Linux

I can ssh to my vps at home,but it did not work when I wanted to connect it through my lab computer.when I ssh by xshell it showed :
Socket error Event: 32 Error: 10053.
Connection closing…Socket close.
Connection closed by foreign host.

also by using shadowsock as a vpn,I could connect to the service when used the computer at home or phone in wifi condition.but fail to connect on my lab computer or phone in 4G network

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

It is possible that when you created your Droplet, you had an SSH key saved into your DO account (

These SSH keys are usually device specific, meaning that while the public key (~/.ssh/ is stored on your DO account, the private key is only on your computer at home. I assume the ‘lab’ computer is a class (shared) computer, which means you could put your private key on it (~/.ssh/id_rsa). Although you should probably give some thought to how secure the shared computer is first, as that key could provide direct access to your VPS.

  • This doesn’t seem to work. I tried a lot of methods, reset the droplets, regenerate the key, but still suggest Connection closed by x.x.x.x port 22