After installing HestiaCP, SFTP may stop working while SSH continues to function. This issue occurs due to an incorrect SFTP subsystem configuration in the SSH configuration file. This guide explains how to identify and fix the problem.
Step 1: Verify the SFTP Server Location
Run the following command to locate the installed SFTP server binary:
find / -name "sftp-server" 2>/dev/null
The output should display paths similar to:
/usr/lib/openssh/sftp-server /usr/lib/sftp-server
Step 2: Update the SSH Configuration
If the SSH configuration is pointing to a non-existent SFTP subsystem, update it with the correct path.
- Open the SSH configuration file:
sudo nano /etc/ssh/sshd_config
- Locate the following line:
Subsystem sftp internal-sftp-server
- Replace it with the correct SFTP server path found in Step 1, such as:
Subsystem sftp /usr/lib/openssh/sftp-server
- Save the file and exit (
CTRL + X
, thenY
, thenENTER
).
Step 3: Restart SSH Service
Apply the changes by restarting the SSH service:
sudo systemctl restart ssh
Step 4: Test SFTP Connection
Verify that SFTP is working by running:
sftp -v root@your-server-ip
If the connection is successful, the issue has been resolved. If the problem persists, check for firewall rules or Fail2Ban restrictions.
This process restores SFTP functionality after installing HestiaCP, ensuring SSH correctly references the installed SFTP server.