Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup vsftpd and my users correctly. I can connect to the ftp with my user but I can't create any directory or file. My websites folder will be there: /srv/www/domain

vsftpd.conf

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES

Directory permissions

drwxrwxr-x  4 root www-data 4096 Oct  5 20:58 www

drwxrwxr-x 2 user_ftp www-data 4096 Oct  5 22:19 domain

User group

user_ftp => www-data


It's strange because when the domain folder have:

  • 755 permission: I can't connect to my FTP account (500 OOPS: vsftpd: refusing to run with writable root inside chroot()) but I can add files & folders (if i change the permission when i'm logged)
  • 575 permission: I can connect, but can't edit/delete/add files & folders

What I'm doing wrong :)?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

My solution.

with chroot_local_user set to YES, the root should be the owner of the home directory, after that you can create other directory and assign permission to the FTP USER so he can do everything he want.

Root user access/permission to /srv/www/domain FTP user access/permission to /srv/www/domain/public_html

share|improve this answer

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.