Server unexpectedly closed network connection
If you get this error message while connecting to your server, it is most usually caused by the server not being able to run some process necessary to support your session. Always try to connect with another SSH ( SFTP ) client to find, if it is server or client related problem.
- Shell.
- Your account may not be allowed to start a shell at all. With some servers (like OpenSSH or Sun SSH), you may need to be allowed to start a shell, even if using SFTP protocol.
- Also some servers refuse to start a shell if your password has expired or your account was terminated.
- Some shells do not work with non-interactive sessions. The same is true for some configurations (or profiles used) for otherwise working shells. This commonly exhibits with SCP protocol with associated error message “Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).” Try to force bash shell explicitly on SCP/Shell page of Advanced Site Settings dialog. Using SFTP protocol instead of SCP is another option.
- OpenSSH server may fail to start shell when chroot is configured, but not possible (e.g. due to group writeable permissions to chroot directory).
- Some environments require specific permissions (e.g. 755) to files like .profile or .bashrc .
- Your account may not be able to start SFTP server binary (e.g. /bin/sftp-server ) or the binary is not present on your server.
- Your SSH server may also lack the SFTP subsystem.
- Your SSH server, particularly OpenSSH, may not be able to access the server key files, due to an incorrect permissions.
In a Middle of Session
If you get this error message in the middle of the session, it is usually caused by a fatal error on the server. The server error may possibly be initiated by an error on the client (WinSCP) side.
In both cases check the log file of your server to see an actual reason, it closed connection for.
Contribute
User Approved Software
Total Downloads: Rating:4.8 out of 209 reviews
Recommend
Most Read
- Login Dialog – Configuring Session
- Using Commander Interface
- Installing SFTP/SSH Server on Windows using OpenSSH
- Authentication Progress
- Automate file transfers or file synchronization
- Connect to FTP server or SFTP server
- Bookmark Dialog
- Set up SSH public key authentication
- Connecting to Amazon AWS S3 cloud storage
Last modified: 2025-03-05 by martin
Documentation
Support
Associations
Follow Us
© All rights reserved 2000–2026, WinSCP.net
- WinSCP License
- WinSCP Privacy Policy