View Single Post

   
  #4 (permalink)  
Old 01-19-2008, 06:36 AM
Thomas Richter
 
Posts: n/a
Default Re: suggestions on ftp servers

Hi,

Camilo Rostoker <rostokec@cs.ubc.ca> wrote:
> Thomas Richter wrote:
>> vsftpd can handle it's own userlist. Beside that it supports chrooting
>> and per user configuration.

>
> Thanks for the tip. I checked it out and looks pretty good. I
> downloaded and installed, and all is working fine. Now I just need to
> tune to my system. Do you use vsftpd?


Jepp, I set up vsftpd for some customers.

> I see how I can add virtual users using a seperate user/passwd file, and
> I can even assign different config files per user ... But how can I
> specify a home directory for that user? There doesn't seem to be a
> specific config option for this...


Probably there's a better way to solve this, but the following works
form me[tm]:

1. Set up a system user for a guest account
e.g. ftpuser with /home/ftpuser/

and create a directory for every virtual user under that directory
e.g. /home/ftpuser/user1, /home/ftpuser/user2

set owner to ftpuser and rights to 700.

2. Create a per user configuration directory
e.g. /etc/vsftpd/userconf

and create a configuration file for each virtual user under that directory
e.g. /etc/vsftpd/userconf/user1, etc/vsftpd/userconf/user2
filename and username must be the same
the files content is

local_root=user1

3. Tell vsftpd about the things above

guest_enable=YES
guest_username=ftpuser
chroot_local_user=YES
user_config_dir=/etc/vsftpd/userconf

And that's basicaly it.
Now vsftpd maps the virtual users to ftpuser, reads the virtual user's
config from /etc/vsftpd/userconf/$username and does a chroot to
$ftpuserhome/$local_root

Use at your own risk!

hth

so long tho
--
Posting at the top because that's where the cursor happened to be is
like shitting in your pants because that's where your asshole
happened to be.
Unknown
Reply With Quote