Installing Proftpd on Red-Hat EL 5 or 6

Installing proftpd on Red-Hat EL 5 or 6

Proftpd is one of the best an most wildly used ftp server on unix-like platforms.
You can find proftpd already packaged for many distributions.

Packaged software are easy to install and time saving but if you want the latest version and/or a custom install with specific options you will have to go through source compiling.

First download the latest version:

# wget "ftp://ftp.solnet.ch/mirror/proftpd.org/distrib/source/proftpd-1.3.4a.tar.bz2"
Download the md5 file to check the file data integrity:
# cat proftpd-1.3.4a.tar.bz2.md5
4e3235dc1ef95d36e59721d70c5c489c proftpd-1.3.4a.tar.bz2
# md5sum proftpd-1.3.4a.tar.bz2
4e3235dc1ef95d36e59721d70c5c489c proftpd-1.3.4a.tar.bz2

Unzip and mv the sources on /usr/local/src/ :

# bunzip2 proftpd-1.3.4a.tar.bz2
# tar xvf proftpd-1.3.4a.tar.gz
# mv proftpd-1.3.4a /usr/local/src/

Check if you have gcc rpm :

# rpm -qa|grep gcc
gcc-4.4.5-6.el6.x86_64

You may need to install other packages depending on what you already installed and the the proftpd options you will choose.

# cd /usr/src/local/proftpd-1.3.4a/

Read the install documentation:

# more INSTALL

Run the configuration.
I use –prefix= force proftd to install on /usr/local/proftpd and –enable-autoshadow to be able to use standard and shadow passwords.

# ./configure --prefix=/usr/local/proftpd --enable-autoshadow
# echo $?
0

Build proftpd :

# make
echo \#define BUILD_STAMP \"`date +"%a %b %e %Y %H:%M:%S %Z"`\" > include/buildstamp.h
cd lib/ && make lib
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/lib'
gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -O2 -Wall -c pr_fnmatch.c
gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -O2 -Wall -c sstrncpy.c
...
...
gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -O2 -Wall -c ftpwho.c
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/utils'
gcc -L./lib -o ftpcount utils/ftpcount.o utils/scoreboard.o utils/misc.o -lsupp -lcrypt -ldl
gcc -L./lib -o ftpdctl src/ftpdctl.o src/pool.o src/str.o src/netaddr.o src/log.o src/ctrls.o -lsupp -lcrypt -ldl -L./lib/libcap -lcap
gcc -L./lib -o ftpscrub utils/ftpscrub.o utils/scoreboard.o utils/misc.o -lsupp -lcrypt -ldl
gcc -L./lib -o ftpshut utils/ftpshut.o -lsupp -lcrypt -ldl
gcc -L./lib -o ftptop utils/ftptop.o utils/scoreboard.o utils/misc.o -lsupp -lcrypt -ldl
gcc -L./lib -o ftpwho utils/ftpwho.o utils/scoreboard.o utils/misc.o -lsupp -lcrypt -ldl
[root@frsu0069 proftpd-1.3.4a]# echo $?
0

Install it:

# make install
cd lib/ && make lib
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/lib'
make[1]: Nothing to be done for `lib'.
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/lib'
cd src/ && make src
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/src'
make[1]: Nothing to be done for `src'.
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/src'
cd modules/ && make static
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/modules'
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/modules'
test -z """" -a -z """" || (cd modules/ && make shared)
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/lib/libcap'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/lib/libcap'
...
...
cd lib/ && make install
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/lib'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/lib'
/usr/bin/install -c -o root -g root -m 0644 config.h /usr/local/proftpd/include/proftpd/config.h
cd include/ && make install
make[1]: Entering directory `/usr/src/proftpd-1.3.4a/include'
make[1]: Leaving directory `/usr/src/proftpd-1.3.4a/include'
/usr/bin/install -c -o root -g root -m 0644 proftpd.pc /usr/local/proftpd/lib/pkgconfig/proftpd.pc
test -z """" || (cd locale/ && make install)
[root@frsu0069 proftpd-1.3.4a]# echo $?
0

Proftpd is now installed :

# ls /usr/local/proftpd
bin etc include lib libexec sbin share var

Copy the man pages in the appropriate directories (so you can use them) :

# cd /usr/local/proftpd/share/man/man1
# cp * /usr/share/man/man1/
# cd ../man5
# cp * /usr/share/man/man5/
# cd ../man8
# cp * /usr/share/man/man8/

Test proftpd with the embedded test procedure:

# sh /usr/local/src/proftpd-1.3.4a/sample-configurations/PFTEST.install
Sample test files successfully installed in /tmp/PFTEST.

The script purpose is to create a sample configuration file “PFTEST.conf” in /tmp/PFTEST
Run proftpd :

# /usr/local/proftpd/sbin/proftpd -n -d 5 -c /tmp/PFTEST/PFTEST.conf

(-n for “don’t start as daemon” and -d 5 for debug level “medium”)
Now connect with an ftp client to port 2012 with login proftpd and password proftpd :
on the server you will something like :

# /usr/local/proftpd/sbin/proftpd -n -d 5 -c /tmp/PFTEST/PFTEST.conf
FRSU0001 proftpd[18003]: using TCP receive buffer size of 87380 bytes
FRSU0001 proftpd[18003]: using TCP send buffer size of 16384 bytes
FRSU0001 proftpd[18003]: : using 'mod_ident.c' section at line 32
FRSU0001 proftpd[18003]: : adding section for resolved path '/'
FRSU0001 proftpd[18003] 192.168.0.111:
FRSU0001 proftpd[18003] 192.168.0.111: Config for ProFTPD TEST Installation:
FRSU0001 proftpd[18003] 192.168.0.111: /
FRSU0001 proftpd[18003] 192.168.0.111: AllowOverwrite
FRSU0001 proftpd[18003] 192.168.0.111: TransferLog
FRSU0001 proftpd[18003] 192.168.0.111: RequireValidShell
FRSU0001 proftpd[18003] 192.168.0.111: UseFtpUsers
FRSU0001 proftpd[18003] 192.168.0.111: WtmpLog
FRSU0001 proftpd[18003] 192.168.0.111: Umask
FRSU0001 proftpd[18003] 192.168.0.111: DefaultServer
FRSU0001 proftpd[18003] 192.168.0.111: UserID
FRSU0001 proftpd[18003] 192.168.0.111: UserName
FRSU0001 proftpd[18003] 192.168.0.111: GroupID
FRSU0001 proftpd[18003] 192.168.0.111: GroupName
FRSU0001 proftpd[18003] 192.168.0.111: AuthUserFile
FRSU0001 proftpd[18003] 192.168.0.111: AuthGroupFile
FRSU0001 proftpd[18003] 192.168.0.111: PidFile
FRSU0001 proftpd[18003] 192.168.0.111: TransferLog
FRSU0001 proftpd[18003] 192.168.0.111: RequireValidShell
FRSU0001 proftpd[18003] 192.168.0.111: UseFtpUsers
FRSU0001 proftpd[18003] 192.168.0.111: WtmpLog
FRSU0001 proftpd[18003] 192.168.0.111: IdentLookups
FRSU0001 proftpd[18003] 192.168.0.111: Umask
FRSU0001 proftpd[18003] 192.168.0.111: ProFTPD 1.3.4a (maint) (built Thu Mar 8 2012 14:02:45 CET) standalone mode STARTUP
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): session requested from client in unknown class
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): connected - local : ::ffff:192.168.0.111:2021
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): connected - remote : 192.168.0.20:3392
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): FTP session opened.
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'USER proftpd' to mod_core
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'USER proftpd' to mod_core
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'USER proftpd' to mod_delay
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'USER proftpd' to mod_auth
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching CMD command 'USER proftpd' to mod_auth
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching POST_CMD command 'USER proftpd' to mod_delay
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching LOG_CMD command 'USER proftpd' to mod_log
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'PASS (hidden)' to mod_core
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'PASS (hidden)' to mod_core
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'PASS (hidden)' to mod_delay
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching PRE_CMD command 'PASS (hidden)' to mod_auth
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): dispatching CMD command 'PASS (hidden)' to mod_auth
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): user 'proftpd' authenticated by mod_auth_file.c
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]):
FRSU0001 proftpd[18006] 192.168.0.111 (192.168.0.20[192.168.0.20]): Config for ProFTPD TEST Installation:
…

Proftpd is working!
Now you just have to configure and secure Proftpd …

Leave Comment

Your email address will not be published. Required fields are marked *