Setup FTP Server on Debian-based Linux

FTP or File Transfer Protocol is a network protocol that used to transfer files between host to another host. With FTP server you can make your own private storage or for other purposes, FTP is build on a client/server architecture, this tutorial just explain the FTP server and how to setup FTP Server on Debian-based Linux ?

Step 1

Boot up your Linux, then open up your favorite terminal, and type

$ sudo apt-get install vsftpd

and just wait till the installation is completed, if you get an error “Unable to locate package” you should update your repository, by enter this command :

$ sudo apt-get update

So what is vsftpd ? vsftpd(Very Secure File Transfer Protocol daemon) is an FTP server for Unix like system, for some linux distribution vsftpd is the default FTP server.

Step 2

Now let’s open vsftpd configuration files, to open type :

$ sudo vim /etc/vsftpd.conf

I’ll use vim as my editor you can use your own editor like nano or pico , joe, gedit, or anything else, then press enter to open your configuration, and Viola ! a bunch of text will come up.

Setup FTP Server on Debian-based Linux 1

I’ll try to explain some of the configuration with my own version explaination, hope you understand my explaination.
If a line has a # (comment) marks, just delete # (comment) marks to active those configuration.

This configuration means FTP Server will listen on IPv4 socket not for IPv6.

This configuration means listen on IPv6 instead of IPv4.

Allow anonymous login to your FTP, so anyone can login to your server without any credentials.

Allow local users to login to your server.

Enable any form of write command.

Change user mask for local users, user mask is a command to setting files and directories permission.

Allow anonymous user to upload their files.

Allow anonymous user to create directory.

Show Messages to users when they go into a certain directories.

Enable directory listing with your local timezone.

Enable logging for any kind of downloads and uploads.

Port for transfer connections originate from port 20.

Arrange uploaded anonymous user files to be owned by a different user, in this tutorial all anonymous files will be owned by opnux.

Change Log file location.

Enable log file in standard ftpd xferlog format.

If user is idle for 600 seconds then, that user will be logout automatically.

If no data connection for 120 seconds, then user will be logout automatically.

ftpd_banner=Welcome to blah server
Enable and Configure Welcome message for every user that connect to your ftp server.

After you edit vsftpd configuration file, don’t forget to save !

That’s all for the configuration, so let’s go to the next step.

Step 3

Now in this step just run your vsftpd service by doing this following command :

$ sudo service vsftpd start

or if your vsftpd service has been started just restart the service :

$ sudo service vsftpd restart

Setup FTP Server on Debian-based Linux 2

Step 4

Last step test your ftp server, you can use your own favorite FTP client, i’ll use default FTP Client.

$ ftp localhost

then enter your credentials, if it success, Congratulations ! you’ve been setup your own FTP Server.

Setup FTP Server on Debian-based Linux 3

If you have and suggestion for tutorial : Setup FTP Server on Debian-based Linux, please comment or contact me via the contact page, thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *