Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In CentOS, how can i specify user1 to directory /var/www/html and user2 to directory /home/user2, and as default user3 and all others to there home directory?

My config file has following /etc/vsftpd/vsftpd.conf:

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (default follows)
  • This allow all users to there home directory only, but i need to specify user1 to another directory for full web directory access, and user2 only to his home directory (for personal ftp upload/download)
share|improve this question
up vote 1 down vote accepted

You should use virtualuser setup; Look here there is mine example of what to do. look at local_root=/var/ftpserver/ or at pam.d and change it for mysql. there you should be able to costumize directory and so on.

share|improve this answer

You may get access to WEB folder inside user's standard location - by mounting local folders using

mount --bind

It then works with vsftpd chrooted accounts. Don't forget to add entries into fstab

share|improve this answer

Your Answer


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.