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!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.