Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I own a VPS server. At the moment I havent installed any FTP server on it, I am using SSH and SFTP only. I am using Debian 6 Squeeze and Apache2 service. The web directory is in /var/www/

Well, I wanted to create different FTP accounts and give access to some people to them (one account per user). In my web directory I have an structure like this:

/var/www/mtaplugins/music/mplayer/music/ /var/www/mapuploader/ and more folders inside. I want to create an FTP account which should be able to just access one of those folders and the folders inside them.

I would appreciate some recomendations or stept to follow before installing anything or doing anythong, because I dont have any idea about this.

I was thinking in using ProFTPd but as I saw in the documentation it would just create an account for each user in my server, and I want to not create more users (I always use root)

Thanks in advance

share|improve this question
    
What you are looking for are called "Virtual Users". You'll need to find an FTP server that supports them if ProFTPd doesn't (I'm sure it does, though) –  DerfK Jul 14 '12 at 16:03
add comment

1 Answer

up vote 2 down vote accepted

In this situation, you may install vsftpd and make settings that allow access via ftp for system users to his home directory that will be /var/www/mapuploader/USER1, /var/www/mapuploader/USER2, /var/www/mapuploader/USERN.

So. For Example:

useradd -d /var/www/mapuploader/userN -m -s /bin/bash userN

After this step you'll have a user acoount with the home dir as /var/www/mapuploader/user1, but you need to set the password for this user:

passwd userN

Ans type and re-type the new password, that you should use later to login via ftp. Now install vsftpd

apt-get install vsftpd

And add some changes to the default config file

nano /etc/vsftpd.conf

There you need to set some values for several variables:

anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

chroot_local_user=YES

And the other variables do not touch. Save changes.

Now you need to restart vsftd to re-read the config file:

/etc/init.d/vsftpd restart

Now your system users can access your home directory via ftp.

share|improve this answer
add comment

Your Answer

 
discard

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.