FTP Server

From MEPIS Documentation Wiki

Jump to: navigation, search

Contents

What is an FTP Server?

An FTP server is a server which runs over the File Transfer Protocol. It is a very common protocol which has been used for almost as long as HTTP for transfering files over the internet and between nodes in networks.

There are many different servers that can be used on Linux operating systems besides the ones discussed here: pure-ftp, wsftp, etc.

KDE file server

The easiest way to set up file transfer over the network is to set up KDE file server using "Public File Server" applet (this is actually not a FTP server, but it is an easy way to set up file transfers)

ProFTP

ProFTP is another good FTP server. Info: ProFTP project, features

It can be installed with this command:

apt-get install proftpd

After the installation you should be able to log in using usernames and passwords available on the computer.

If you want to allow anonymous logins look in configuration file /etc/proftpd/proftpd.conf and uncomment the required lines.

The installation places a start link in the appropriate runlevel, therefore ProFTP will start each time the computer boots. To start/stop the server you can use these commands, as root:

/etc/init.d/proftpd start 
/etc/init.d/proftpd stop
/etc/init.d/proftpd restart

You can also install gProFtpd, a graphical config tool for ProFTP

VSFTP

VSFTP is another very good ftp-server. You can set it up in one of two ways: to use VSFTP as a daemon process (i.e. in its own separate process) or as an entry in inetd, which spawns the daemon only when a connection is requested, thus saving system resources and cpu cycles when the server is not in use. See the note below to help you decide which method to choose.

VSFTP is secure, fast, and simple to configure.

apt-get install vsftpd - will download the daemon and begin to run it in that mode. It will also add startup scripts to your rc*.d folders, so the daemon will start each time you boot. If you do NOT see this separate process running after a trial reboot, it will be necessary to remove and recreate the entries for the startup scripts in your rc*.d folders. To do that, execute the removal command, as root:

 update-rc.d -f vsftpd remove

and then the recreate command, as root:

 update-rc.d vsftpd defaults

Note that these are setup steps that ONLY need to be done if you are running it as a daemon process.


No matter which mode you plan to run it in, you'll need to inspect/modify the configuration file, which can be found in /etc/vsftpd.conf and can be edited freely. If you wish to run it instead as a spawned process in inetd, simply comment out or remove listen=YES and then add this entry to your / etc/inetd.conf, using a text editor:

 #:FTP
 ftp	stream	tcp	nowait	root	/usr/sbin/vsftpd	vsftpd

Note: Using inetd is not a good idea if more than a couple people will be using vsftp at the same time, it has been known to become unstable.

Options

Here are some options you might find useful:

write_enable=YES -- alows users write access

anon_root=/home/ftp -- anonymous users root

anonymous_enable=YES -- allows use of anonymous users

local_enable=YES -- allows unix users on the box to login to their home folders

connect_from_port_20=YES -- allows port 20 connections (ftp-control)

idle_session_timeout=6000 -- session timeout in SECONDS

ftpd_banner=Welcome to my FTP. Behave! -- displays to users using ftp clients

For passive mode

pasv_enable=YES -- passive mode, enables passive connections (using a seperate port for data transfer)

pasv_min_port=64990

pasv_max_port=65000

Other Options

Other options can be found at http://vsftpd.beasts.org/vsftpd_conf.html

Connectivity issues

  • Make sure your firewall doesn't block the port that your server uses.
  • If you want to use your server to share files to the Internet:
    • Your computer should have either a real IP address, or if it uses NAT, your have to forward the port used by the remote access programs to the local IP address assigned to your computer.
    • Make sure that your IP address doesn't change, if you don't have control over it, try the free Dynamic DNS service offered by dyndns.com
Personal tools
In other languages