Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to setup a ftp account for a user that has read/write access to one folder: /items/myuser

I've set up the account with username 'myuser' in Linux with the adduser command. After that, I've changed my /etc/vsftpd.conf file to:

chroot_local_user=NO
chroot_list_enable=YES
user_config_dir=/etc/vsftpd_user_conf

I've also edited the /etc/vsftpd.chroot_list and added 'myuser' to this list.

After that, I've edited /etc/vsftpd_user_conf/myuser and added the following line:

local_root = /items/myuser

After that, I've created this local_root folder and ran the following commands:

chown myuser:myuser /items/myuser
chmod ug-w /items/myuser

mkdir /items/myuser/homefolder
mount --bind /items/myuser /items/myuser/homefolder

I can login and I'm restricted to this folder and his subfolders but when I want to write a file, I'm getting an 553 error.

Does anyone know what I've forgotten to do?

Thanks in advance!

share|improve this question
add comment

2 Answers 2

You are removing the user's permission to write his home:

chmod ug-w /items/myuser

By the way, what is the purpose of this bind-mount?

mount --bind /items/myuser /items/myuser/homefolder
share|improve this answer
add comment

I have it working now. I've searched some around on the internet and I've found a workaround. As my local_root must not be writeable, I've created a subfolder inside this this unwriteable directory with write permissions because only the root directory needs to be unwriteable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.