'SFTP - "EOF while reading packet" error in PhpStorm, works fine in FileZilla
I'm trying to get an SFTP connection working in PhpStorm. It works fine in FileZilla.
In the SSH config section of the STFP config, I enter host, username and auth type (password) and click Test Connection. It connects fine.
If I click OK and go dialog level back and click Test Connection on the main SFTP config, I get Connection to dev.the-server.net failed. EOF while reading packet error. Like wise when I close the SFTP config dialog, there is an EOF while reading packet error where a directory listing should be.
If I use the same credentials and connect by FTPS, I can get a remote directory listing and download files, but I get the end of file error trying to upload.
This all seems to be PhpStorm issue because I can upload and download fine with FileZilla. For workflow reasons, I really need PhpStorm to connect.
Any thoughts on where to start?
Images of the SFTP dialog:
Solution 1:[1]
Restarting PhpStorm helped to solve the problem.
Solution 2:[2]
For me, it failed because sftp-server was configured with the wrong path in sshd_config, and this link saved me. so:
- Find the correct path of
sftp-server(thewhereis sftp-servercommand may be help), e.g./usr/libexec/sftp-server. - Set the correct path in
sshd_config(most likely in/etc/ssh/sshd_config), e.g.Subsystem sftp /usr/libexec/sftp-server. - Restart the
sshdserver (possibly/etc/init.d/sshd restartor/usr/sbin/sshd restart). - Restart your IDE.
Solution 3:[3]
In my case I've changed SSH settings, restarted SSH service, restarted PHPStorm but it didn't help. But when I restarted the whole server and then tried again it started to working again.
Solution 4:[4]
In my case I didn't install openssh in server. You can try this command.
sudo apt-get install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vitaly |
| Solution 2 | |
| Solution 3 | Marcin Nabiałek |
| Solution 4 | dragon fly |


