Home Download Ubuntu

Install FTP server on Ubuntu (proftpd)

The first step is to install ProFTP on the server

sudo apt-get install proftpd




It is preferable to continue the installation in standalone, this way the FTP server will always be receptive. If you choose inetd, the FTP server will only be launched when a connexion is initialized.



Parameters:

sudo nano /etc/shells


And add a line "/bin/false" at the end of the file.

Now let's create ftp folders and the upload and download, with 'read only' rights on download and 'read/write' for upload, so that users can upload files.

Create both folders:

cd /home/ftp/
sudo mkdir download upload


Make "download" read-only and "upload" read/write:

cd /home
sudo chmod 755 ftp
cd ftp
sudo chmod 755 download
sudo chmod 777 upload


Now it time to create an account, which will have access to the FTP

sudo useradd user_of_your_choise -p password_of_your_choise -d /home/ftp -s /bin/false
sudo passwd user_of_your_choise


Now all that's left is to edit the configuration file to modify your server configuration (port address, server name, number of people who can connect)

sudo nano /etc/proftpd/proftpd.conf


ServerName "Ubuntu"

- is used when users logon
ServerType standalone

- is the type of server we want. "standalone" for a few users, if we want more, we use "inetd" (no quotes)
DefaultRoot ~

- this is the important part, when users are jailed to their root folder, not being able to walk around your files on the server.
Port 21

- the port where users will connect to this server. Usually this is 21.
MaxInstances 30

- this is maxium of concurrent connections to your computer.
SystemLog /var/log/proftpd/proftpd.log

- this is the log file

After that we need to restart proftpd to make changes available:

sudo /etc/init.d/proftpd restart


Resources: Gandi.Net, Howtoforge.org

0 comments:

Post a Comment