ProFTPd

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 08:15, 3 May 2007 (edit)
Mcpat (Talk | contribs)

← Previous diff
Revision as of 08:17, 3 May 2007 (edit) (undo)
Mcpat (Talk | contribs)

Next diff →
Line 31: Line 31:
=Config File= =Config File=
-Use '''vi /mmc/jffs/etc/vsftpd.conf''' to open file+Use '''vi /mmc/opt/etc/vsftpd.conf''' to open file
If you would like to use root only use the following: If you would like to use root only use the following:

Revision as of 08:17, 3 May 2007

by mcpat

Contents

Requirements

First be sure that you have enough memory free. Because of this I describe the installation on SD-cards (/mmc). Additionally this procedure will show how to install even the needed ipkg packages on the SD-card.

It is also possible to replace every occurances of (/mmc) with (/jffs) if you have it enabled.

Preparation

Install first optware!

Then install xinetd

Then install proftpd

Installing xinetd

Installation of xinetd:

  /opt/bin/ipkg install xinetd

Installing proftpd

Installation of proftpd-Server:

  /opt/bin/ipkg install proftpd


Config File

Use vi /mmc/opt/etc/vsftpd.conf to open file

If you would like to use root only use the following:

# This is a basic ProFTPD configuration file (rename it to 
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName			"ProFTPD Default Installation"
# ServerType			standalone
ServerType			inetd
DefaultServer			on
WtmpLog                         off


# Port 21 is the standard FTP port.
Port				21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# 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			10

<Global>
  RootLogin On
  RequireValidShell off
  AuthUserFile /etc/passwd
  AllowOverwrite on
  AllowRetrieveRestart on
  AllowStoreRestart on
#  TransferRate RETR 25
#  TransferRate APPE,STOR 100:2048
</Global>


# Set the user and group under which the server will run.
# User				nobody
User root
Group root
# Group				nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~
DefaultRoot /mmc/opt

# Normally, we want files to be overwriteable.
AllowOverwrite		on

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
  DenyAll
</Limit>

For anon login add the following in your vsftpd.conf file. Before you use this realize you will be giving anon login FULL ACCESS

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous ~ftp>
  User				ftp
  Group				ftp

  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias			anonymous ftp

  # Limit the maximum number of anonymous logins
  MaxClients			5

  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin			welcome.msg
  DisplayFirstChdir		.message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>
</Anonymous>


Start script for proftpd (standalone server)

Please set following in the proftpd.conf

ServerType			standalone

The following script starts proftpd:

  COMING SOON

Don't forget to give the execute privilege (chmod x start).

Start script for proftpd (via xinetd)

The following script starts proftpd:

  COMING SOON

Don't forget to give 0644 privilege (chmod 644 proftpd).

Firewall settings

To get the FTP-Server enabled from WAN side add the following line to the firewall section:

  /usr/sbin/iptables -I INPUT 1 -p tcp --dport 21 -j logaccept