How does a vsftpd server work and how to configure it?

Posted by ysap on Server Fault See other posts from Server Fault or by ysap
Published on 2012-06-29T23:08:34Z Indexed on 2012/06/30 3:17 UTC
Read the original article Hit count: 584

Filed under:
|
|
|

I was asked to configure a FTP server, based on the vsftpd package. The server is running on a remote machine to which I have a superuser privilege access.

Being unfamiliar with the mechanics of FTP servers, I tried to figure out how user ftp accounts are configured. The previous maintainer used a shell script, which works on a list that we maintain to track users accounts and passwords, to configure the ftp accounts. From reading the script, I see that he generates a list of usernames and passwords, and actually creates a user account on the Linux machine. This means that for each user that we configure in the list, a new user account is being added by the adduser command:

adduser --home /home/ftp --no-create-home $user

(but w/o a private /home/username directory - using the /home/ftp instaed).

Each of these users can log into his account using the ssh command. This fact seems a little strange to me, as I'd think that the ftp account should be decoupled from the Ubuntu user accounts.

As another side effect, when a user connects using a web browser, he is connected to the /home/ftp directory. However, he can then use "Up to a higher level directory" link to go up and effectively have access to all of our system.

So, the questions are:

  1. Is this really how the FTP server supposed to work in terms of configuring ftp accounts?

  2. If not, how do I configure the vsftpd server in a way that I have only the superuser Ubuntu account on that machine and all ftp account are... just FTP user accounts? Additionally, these ftp account should be configured in terms of how and what they are allowed to access.

© Server Fault or respective owner

Related posts about ubuntu

Related posts about ftp