Report this

What is the reason for this report?

Setting up an ftp user to upload website files

Posted on October 14, 2025

I have created a user, edited the /etc/ssh/sshd_config file with the user ChrootDirectory. Ssh restarts no problem. Filezilla connects but then the system immediately disconnects. I want this user to access multiple websites so I made a folder in /var/www and set the user as the owner of that folder - which seems like a bad idea (following and AI suggestion). But it won’t stay connected. What am I missing?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It might be that the ChrootDirectory setting is causing the disconnect. When a user is chrooted, the directory must be owned by root and not writable by anyone else, otherwise, the SFTP session will fail. Since you want this user to access multiple folders, that setup could be too restrictive.

You could try removing the chroot part and just rely on regular SFTP access through SSH instead. As long as permissions under /var/www are set correctly, that should work, but it depends a bit on your exact setup.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.