Tuesday, May 29, 2012

Setting up and FTP server in Linux

This tutorial is for Gnu/Linux operating systems. Windows users can use the filezilla server: http://filezilla-project.org/download.php?type=server

A server is the name given to a piece of hardware running software that allows it to interact with client computers. All websites run on servers. This is a tutorial that uses a set of tools to configure a special type of server that uses FTP, the File Transfer Protocol. This is used for the transfer of files between computers. It is similar to what cloud storage services such as Dropbox or Skydrive offer.

The tools
To get the server running we will be using gadmin-proftpd. This is a GTK+ frontend to proftpd, the command line tool. Download it from sudo apt-get install gadmin-proftpd. Run it and enter the root password. The next few sections will describe each tab you need to fill in.

Servers
You need to fill in some of these blank fields. For Server Address use the inet addr from wlan of the ifconfig output in the terminal. The server name can be anything. Admin email should be your real email address. Skip down to where it says "signed certificate settings". You should fill this information in and use the "Apply" button to make a new certificate. Failure to complete this step of the setup process is what causes most errors with gadmin-proftpd.

Users
Users is the last tab you should have to fill out.  Fill in the username and password as you want them. Others will need to fill in this information, so make it reasonable. Go to the bottom and click "Add Directory". You should make a directory in /var/www called ftp (it can be called whatever you want it to be) that will act as this new user's directory. This will become the root ftp directory for that user (kind of like / for a normal user). If you want full access over a machine, make this "/".  Click "New User". This user will now be created.

Afterwards
 At the top of the application, click "Activate". The server will then be running. To access the server, go to your browser and type: "ftp://[your ip]" where [your ip] is you full ip address. To add directories and upload data you will need a program like bareftp, (sudo apt-get install bareftp) filezilla (which doesn't play nice with proftpd servers), or a windows program like coreftpd.

Extras
This is a local server only. You can make it point to the internet in your router settings. Your router setup (the ip address of your router, sometimes 192.168.0.1) should have some type of "advanced" dialog where you can set up your server. FTP runs on port 21, so you would need to fill in the protocol, port, and IP address wherever the dialog may ask for it. If it asks for a name like our D-link router does, fill it in with the name of your computer. Now, when you visit your external ip address (find this with "ip" on google) using the ftp protocol it will go to your server.

You can also use a no-ip.com host (which are free) to avoid the need to remember the ip address of the server.

1 comment:

  1. BlueHost is ultimately the best website hosting provider for any hosting plans you require.

    ReplyDelete