Plesk Server: SSH Works, SFTP Doesn't (FileZilla, PHPStorm)
In this article, we will explore the issue of SSH working fine while SFTP fails on a Plesk server, specifically on Plesk Obsidian 18.0.64 build1800241008.13, running on Ubuntu 20.04 and 20.04.1 LTS, hosted on IONOS.
Background
SSH (Secure Shell) and SFTP (SSH File Transfer Protocol) are both network protocols that provide secure file transfer functionality. However, they use different mechanisms to connect and transfer files. SSH uses port 22 by default for secure shell access and command line execution, while SFTP uses the same port for secure file transfers. Sometimes, you may find that SSH works without issues, but SFTP fails, especially when using clients such as FileZilla or PHPStorm.
Understanding the Issue
When experiencing an issue where SSH works but SFTP doesn't, this may be caused by a restrictive firewall rule, wrong permissions for the SFTP user, or misconfiguration in the Plesk panel. In this specific case, we will focus on the Plesk server run on Ubuntu 20.04 and 20.04.1 LTS, hosted on IONOS.
Troubleshooting Steps
To investigate and resolve the issue when SSH works but SFTP does not using FileZilla or PHPStorm, follow these steps:
-
Check Firewall Rules:
sudo ufw statusEnsure that both SSH and SFTP are allowed through the firewall. In case of IPTABLES, use:sudo iptables -L -n -
Check SSHD Configuration:
sudo nano /etc/ssh/sshd_configEnsure that the following line is uncommented:#Subsystem sftp /usr/lib/openssh/sftp-serverComment it out by adding a '#' in front, if it is not:
Subsystem sftp /usr/lib/openssh/sftp-server -
Check Plesk SFTP Configuration:
sudo plesk sftp -d /var/www/vhosts/yourdomain.comsudo plesk sftp --help -
Check User Permissions: Ensure that the user has proper permissions for the directories in question.
Additional Resources
In this article, we discussed the issue where SSH works but SFTP fails on a Plesk server, specifically on Plesk Obsidian 18.0.64 build1800241008.13 running on Ubuntu 20.04 and 20.04.1 LTS, hosted on IONOS. We covered the background, the possible causes, and the troubleshooting steps. By following these steps, you should be able to resolve most of the similar issues with SFTP on Plesk servers.