Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.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: Wed, 10 Aug 2011 18:37:29
Message-Id: CAEH5T2NUGAs_r9SPxN-EEsmorJ+=-QDYqTAtuTEPjs4E9sT6mQ@mail.gmail.com
In Reply to: [gentoo-user] vsftpd: how can I chroot both anon and auth users to the same dir? by Jarry
1 On Wed, Aug 10, 2011 at 11:37 AM, Jarry <mr.jarry@×××××.com> wrote:
2 > Hi,
3 > I'm using vsftpd and I'm quite satisfied, except for one
4 > problem which I can not solve:
5 >
6 > Anonymous users are chrooted to base ftp-server directory
7 > /home/ftp but local users are chrooted to their own
8 > directories /home/ftp/$USER and they can not move higher.
9 > The only way for them to see directories of other local
10 > users is to log-off and log-in as anonymous. This is not
11 > very convenient. Why should authenticated user be allowed
12 > less (in this particular aspect) than anonymous?
13 >
14 > So I'd like to change it the way that both anonymous
15 > as well as local users are chrooted to base ftp directory
16 > /home/ftp but I do not know how to do it.
17 >
18 > Whe I remove "chroot_local_users=YES" from vsftpd.conf,
19 > local users are not chrooted at all, and can move
20 > around the whole system up to /. And when I let that
21 > "chroot_local_users=YES" activated, they are chrooted
22 > to home-dirs. So how can I solve this problem?
23
24 I haven't used vsftpd in a long time but I believe you can do
25 something like this:
26
27 Set user_config_dir to point to someplace such as /etc/vsftpd/users
28
29 In that directory, create files for each username and within it put:
30 local_root=/home/ftp
31
32 I think that might set all of those users to login to that folder. I
33 have not tried it. :)
34
35 There was also an option to use alternative home directories rather
36 than the one specified in /etc/passwd, but I can't remember exactly
37 what that was and it may have still used the username as part of the
38 path. "man vsftpd.conf" should explain it.

Replies