This question already has an answer here:

I am trying to restrict all FTP users to the directory /jannik with the vsftp-daemon. I don't want them to go anywhere but the folder /jannik and it's sub-folders. Also, I don't want them to have write permission.

What you should know:

  • I have the following common settings

  • I use a user blacklist to only allow one specific account to access the ftp (userlist_deny=NO; userlist_enable=YES; userlist_file=/etc/vsftpd.user_list)

  • In the user_list I've only one user (root)

Again, what I would like to accomplish:

  • Only allow that user to access /jannik and all it's sub directories

What I've tried to far:

  • Setting local-root=/jannik => This lets my ftp users all log on to the correct dir, but they can use /../ in the URL to get out of the directory, letting them full access to all my files on the VPS server I own.

  • Additionally setting chroot_local_user=YES gives me an error: "500: OOPS: vsftpd: refusing to run with writeable root inside chroot()"

Do you have the idea, what could be wrong? I do not want to chroot their home directories, only to the given single directory.

marked as duplicate by Drav Sloan, G-Man, Anthon, cuonglm, Stephen Kitt Aug 9 '15 at 21:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.