Report this

What is the reason for this report?

Create virtual users on Ubuntu 16.06

Posted on June 7, 2017

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!

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.

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

  1. service vsftpd restart

After that the error should not be present.

Hope that this helps!

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.