SFTP not working (but SSH does)

Hello,

I installed Hestiacp, so far working (ubuntu 24 lts) ; i can connect to the panel, I can connect with the root account in SSH… but I can’t connect with sftp as root (nor with any user account) ; did i misses something ? I didn’t changed any files. Firewall allows port 22. I have no error message, just the connexion never starts. SSH (same passwords) working great so i am a little bit lost… If someone could please help me out ?

1 Like

same thing happen to me. even few mints go i was using Sftp as root but after restart the server its stop working.
in putty SSH is working i can connect fine.
but when im using Sftp (FileZilla) im getting error
Error: Could not connect to server

pls help to fix it

1 Like

Show the output of this command:

grep -i sftp /etc/ssh/sshd_config

here

# Hestia SFTP Chroot
Match User sftp_dummy99,adminpro,admin2,admin123pohub,adminhdflix,adminapi,admin7,admin5,admin4,admin6,admin3,admin8
ForceCommand internal-sftp -d /home/%u

I have the following

root@hetzner-cp2 ~ # grep -i sftp /etc/ssh/sshd_config
Subsystem sftp internal-sftp-server
# Hestia SFTP Chroot
Match User sftp_dummy99,client,synexta
ForceCommand internal-sftp -d /home/%u

It’s strange that you don’t have the Subsystem directive.

Show all the contents of the file.

grep -Ev '^#|^$' /etc/ssh/sshd_config

Output is

root@hetzner-cp2 ~ # grep -Ev '^#|^$' /etc/ssh/sshd_config
Include /etc/ssh/sshd_config.d/*.conf
LoginGraceTime 1m
PermitRootLogin yes
KbdInteractiveAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
DebianBanner no
AcceptEnv LANG LC_*
Subsystem sftp internal-sftp-server
 
Match User sftp_dummy99,client,synexta
    ChrootDirectory /srv/jail/%u
    X11Forwarding no
    AllowTCPForwarding no
    ForceCommand internal-sftp -d /home/%u

Use these commands to fix it.

sed -i 's/internal-sftp-server/internal-sftp/' /etc/ssh/sshd_config
systemctl restart ssh
4 Likes

Working thanks ! where is the error from ? because i just made a clean install following the installation script…

worked thank you sir

It’s a bug that will be fixed in next release.

2 Likes

my first experience in Hestiacp… just hugely appreciate the support, thanks !

1 Like

Subsystem sftp /usr/lib/sftp-server-server

I noticed that after the update the sftp line was updated and became incorrect. I corrected it and sftp worked from the root user. I haven’t tested it for others.

That case is also fixed in the PR.

1 Like