By tsogiaidze
Hello,
I want to create virtual users that will have dedicated jailed folders(in /var/www/html/users…) with chroot, these users should connect using ftp(vsftpd).
To do this I have followed the steps from approved answer from the link: https://askubuntu.com/questions/575523/how-to-setup-virtual-users-for-vsftpd-with-access-to-a-specific-sub-directory Only difference is that I have left “listen=NO”
Everything seems to be set up okay, only problem is that when I try to connect with ftp, it gives error “500 OOPS: cannot change directory:”.
I have found here how to solve the problem: https://nurikabe.blog/2009/06/15/defeating-vsftp-error-500-oops-cannot-change-directorysomedirectory/ According to this solution I have to run command “getsebool -a | grep ftp”, when I run it I get “getsebool: SELinux is disabled” error. When I run the command “getenforce” it returns “Disabled” despite file in /etc/selinux/config looks like this (SELINUX=enforcing):
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# default - equivalent to the old strict and targeted policies
# mls - Multi-Level Security (for military and educational use)
# src - Custom policy built from source
SELINUXTYPE=ubuntu
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
As a bottom line, my problem is that I can’t enable SELinux.
Any ideas what can be the reason of the problem?
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!
Hello @tsogiaidze
This will happen when you attempt to connect via ftp to user which is configured to jail and prevent him to access other directories.
You can modify the vsftp config file and add the following line:
allow_writeable_chroot=YES
- service vsftpd restart
After that the error should not be present.
Hope that this helps!
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.