Saturday, 23 April 2011

ProFTPD(File Transfer Protocol) setup on Linux

Installation
$ sudo apt-get install proftpd

root@dragonaider:/home/sahilsk# sudo apt-get install proftpd
Reading package lists... Done
Building dependency tree       
Reading state information... Done .....



Once done installting, start configuring your /etc/proftpd/proftp.conf  file
Important settings are mentioned below:

#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6 on
# If set on you can experience a longer connection delay in many cases.
IdentLookups off

ServerName "cronfarm"
ServerType standalone
DeferWelcome off

MultilineRFC2228 on
DefaultServer on
ShowSymlinks on

TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200

DisplayLogin                    welcome.msg
DisplayChdir               .message true
ListOptions                 "-l"

DenyFilter \*.*/

# Use this to jail all users in their homes 
DefaultRoot /home/sahilsk/cronfarm/public/user_projects/

# Port 21 is the standard FTP port.
Port 21
...

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30

# Set the user and group that the server normally runs at.
User proftpd
Group nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022  022
# Normally, we want files to be overwriteable.
AllowOverwrite on

# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd off
........................
......................

Explaination:

ServerName:   Name anything you wanna call your server
ServerType :   standalone/inetd 
inetd :  Doesn't support many connections but good for small use. It also minimize the resources being used by proftpd daemon.
standalone: more cpu resource usage . Good for large connection and ftp usage.

DefaultRoot: By default it's set to (~) /home/user/ . It's the directory which'll become your ftp root.

Lets try connecting to our ftp server.

One done configuring your /etc/proftpd/proftpd.conf file,  save it and close it.

Run proftpd server : proftpd  stop/start/status

root@dragonaider:/home/sahilsk# /etc/init.d/proftpd stop
 * Stopping ftp server proftpd    


now, lets confirm it.
open filezilla and enter following parameter:
host: localhost
username: your usernam on your system
password: your usual  password on your system





Don't get confused with "Remote site: /" . '/' is not my root folder, but it's folder which i set as root in proftpd.conf  "DefaultRoot" option

No comments:

Post a Comment