Wednesday, December 28, 2016

centos - How to allow user1 to 1 directory and another user2 to another directory. Not only home directory




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().
#chroot_list_enable=YES
chroot_local_user=YES

# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list



  • 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)


Answer



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.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...