Gentoo Archives: gentoo-user

From: Jarry <mr.jarry@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] vsftpd: how can I chroot both anon and auth users to the same dir?
Date: Fri, 19 Aug 2011 18:46:38
Message-Id: 4E4EAF11.6080809@gmail.com
In Reply to: Re: [gentoo-user] vsftpd: how can I chroot both anon and auth users to the same dir? by Paul Hartman
1 On 10-Aug-11 20:36, Paul Hartman wrote:
2 >
3 >> So I'd like to change it the way that both anonymous
4 >> as well as local users are chrooted to base ftp directory
5 >> /home/ftp but I do not know how to do it.
6 >
7 > Set user_config_dir to point to someplace such as /etc/vsftpd/users
8 > In that directory, create files for each username and within it put:
9 > local_root=/home/ftp
10
11 Actually, instead of creating file for each username I included
12 these options in main config file /etc/vsftpd/vsftpd.conf:
13
14 chroot_local_user=YES
15 local_root=/home/ftp
16
17 Now it works as I expected: both anonymous & local users are
18 chrooted to /home/ftp and can enter any sub-directory, but
19 local users can upload files to /home/ftp/$USER (homedirs
20 where they have write permission).
21
22 On 10-Aug-11 20:19, Michael Orlitzky wrote:
23 >
24 > Are they local users? Change their home directories to /home/ftp.
25
26 I did not test this, but it might work too. The only drawback
27 is I'd have to edit /etc/passwd always when I add new user.
28
29 Problem solved, thank you for help...
30
31 Jarry
32 --
33 _______________________________________________________________
34 This mailbox accepts e-mails only from selected mailing-lists!
35 Everything else is considered to be spam and therefore deleted.