I have a problem: I've been given an account on a testing-box. My public RSA key has been added to my account and I can connect just fine using programs such as WinSCP or Git bash. However, when I try to use PuTTY, like I always do, the server immediately closes the connection, only displaying Server unexpectedly closed network connection.

WinSCP also has a feature to open the current connection using PuTTY. Note: I am already successfully connected to the server at this point using my username and public-key. However, this results in the same Server unexpectedly closed network connection message immediately.

I have tried to connect to the server with no credentials pre-entered but was unable to do so either (same message).

What reason could this have, and how can this be resolved?

  • 2
    Have you checked connection with a updated putty version?. I think it could be a protocol version problem. – F.Igor Oct 24 '16 at 16:15
  • @Igor Indeed, this was the only thing I did not try yet. Looks like the latest version of PuTTY does indeed solve the issue. If you make it an answer I'll accept it :) – Lolmewn Oct 24 '16 at 16:22

Newer versions of Putty comes with updated protocols that some ssh servers are using actually. Updating the version to the latest available could solve the issue.


Try to check the shell configured in /etc/passwd for your user, then check if /etc/ssh/sshd_config allow sftp-only session for your user.

  • Thanks for the comment, however, a solution to my problem was already found. Furthermore, git bash was able to connect just fine, ruling out SFTP only since it uses regular SSH. – Lolmewn Oct 24 '16 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.