ProFTPD
Author: jason
Date: 2003-11-23
Category: Technical

Installing ProFTPD in FreeBSD is the same as Linux. Don't listen to the hype! You don't need to install from ports. ProFTPD can compile just fine on FreeBSD without ports. Just do it yourself!!

Since I'm not using the GUI I downloadeded proftpd-1.2.9.tar.gz from http://www.proftpd.org on my WinDoze box. Used WinSCP2 to transfer to file to my /home account. Logged in with putty.

>cd /home
>tar -zxvf proftpd-1.2.9.tar.gz
>cd proftpd-1.2.9
>cat INSTALL |more
>cat README |more
*you know it's a good idea*
>su
*if you're not root already*
>./configure
>make
>make install
>cp /home/proftpd-1.2.9/sample-configurations/basic.conf /usr/local/etc/proftpd.conf
>cd /usr/local/etc/rc.d
>cp proftpd.sample.sh proftpd.sh
>chmod 755 proftpd.sh
*you may not have a startup script, if not I've put a sample of mine below*

Here are the default install directories:
proftpd - /usr/local/local/sbin/
proftpd.conf - /usr/local/etc/
proftpd.scoreboard - /usr/local/var/proftpd
proftpd.pid - /usr/local/var
proftpd.sh.sample - /usr/local/etc/rc.d/
ftpwho - /usr/local/bin/
ftpcount - /usr/local/bin/
ftptop - /usr/local/bin/

Here's what my proftpd.sh looks like, in case you don't get one:
Code

#!/bin/sh

case "$1" in

start)
/bin/mkdir -p /usr/local/var/proftpd
if [ -x /usr/local/sbin/proftpd ]; then
/usr/local/sbin/proftpd
echo -n ' proftpd'
fi
;;

stop)
killall proftpd
;;
*)
echo "$0 start | stop"
;;

esac


I also used this code to start up my shoutcast, by changing the appropriate references...

Read up on the proftpd config files here: http://www.proftpd.org/docs/example-conf.html

Here's my config file:
Code

# jasonthomasfrance's ProFTPD configuration file

ServerName "jasonthomasfrance.org"
ServerAdmin jason@jasonthomasfrance.com
ServerIdent on "jasonthomasfrance.org"
ServerType standalone
DefaultServer on
Port 21

# Add some greetings after login
# Reference http://www.proftpd.org/docs/directives/linked/config_ref_DisplayFirstChdir.html
# for some neat stuff with %
#AccessGrantMsg "Hello %u, welcome to jasonthomasfrance.org"
AccessDenyMsg "Please try again, or go away"
DisplayLogin .welcome
DisplayQuit .quit

# Speed up logging in
IdentLookups off
UseReverseDNS off

# Speed up directory listings
AllowOverride off

# 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 30
MaxLoginAttempts 3

# Cut down on some annoyance
MaxClientsPerHost 2
MaxClientsPerUser 2
MaxHostsPerUser 1

# How quickly do we kick someone out
TimeoutLogin 120
TimeoutIdle 600
TimeoutNoTransfer 900

# Don't give the server banner until after authentication
DeferWelcome on

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

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

# Normally, we want files to be overwriteable.

AllowOverwrite on


# Allow FXP
AllowForeignAddress on

# Resume Downloadling
AllowRetrieveRestart on

# Resume Uploading
AllowOverWrite on
AllowStoreRestart on

# Logging
SystemLog /var/log/ftp.log
ExtendedLog /var/proftpd/ftp.log read,write


Make sure the user and group exist!! In RedHat I used apache, apache because nobody wasn't there.

To start/stop proftpd

If you are using the proftpd.sh script you can issue:
>/usr/local/etc/rc.d/proftpd.sh start
>/usr/local/etc/rc.d/proftpd.sh stop

If you don't want to (or can't) use the .sh script then to start:
>/usr/local/sbin/proftpd

To stop you have to find and kill the proftpd pid:
>ps -aux
>kill 111 (where 111 is the proftpd pid)

To check who is logged on issue ftpwho. Or ftpcount, for a quick count. Or ftptop to check what people are getting. To get out of ftptop hit Ctrl+Z.

Now you're a proftpd geek!

*********
written by jasonthomasfrance
date 23 Nov 2003
systems RedHat 9.0, FreeBSD 4.8
*********



jason @ jasonthomasfrance.com - www.masterstationlog.com - copyright 2009