BACK

Installing ProFTPD

  1. Obtain the source and untar and unzip it in a directory of your choice.
       # gzip -cd proftpd-1.2.4.tar.gz | tar xvf -
    
  2. Now, change to the newly created source directory (proftpd-1.2.4).
       # cd proftpd-1.2.4
    
  3. Run the configure script with any additional options you may want.  To view all the available options, use the ./configure --help | less command.
       # ./configure --prefix=/usr/local/ --sysconfdir=/etc --mandir=/usr/share \
       --with-modules=mod_linuxprivs:mod_wrap  --enable-autoshadow
    
    This will set the base directory to /usr/local, install the .conf file in /etc, installs the man pages in /usr/share, and use modules: mod_linuxprivs for more secure authentication and mod_wrap for TCP wrappers, and enables the use of shadowed passwords.
  4. Next compile and install the binaries for proftpd.
       # make
       # make install
    
  5. To test you installation, some example configuration files have been included in the sample-configurations subdirectory.
       # sh sample-configurations/PFTEST.install
       # Sample test files successfully installed in /tmp/PFTEST.
       # ./proftpd -n -d 5 -c /tmp/PFTEST/PFTEST.conf
    
  6. Now open another terminal and connect to the 2021 port as user proftpd with password proftpd.
       # ftp -n -d
       ftp> open <hostname> 2021
       Trying 192.168.1.67...
       Connected to green.bell.net.
       220 ProFTPD 1.2.2rc2 Server (ProFTPD TEST Installation) [green.bell.net]
       ftp> user proftpd
       ---> USER proftpd
       331 Password required for proftpd.
       Password:
       ---> PASS XXXX
       230 User proftpd logged in.
       ftp>
    
  7. Now that you can connect to the ftp daemon, you can kill the TEST Installation and start the real one.  To accomplish this, you will need to find the PID and kill the process.
       # ps x
       [OUTPUT CUT]
       11142  pts/3  S 0:00 proftpd (accepting connections)
       # kill -9 11142
    
  8. Edit the /etc/proftpd.conf file to set up the permissions and directories to share via FTP.  To see the available options, visit www.proftpd.org/docs/configuration.html, and view the Directive list.
  9. Start proftpd from inetd or as a standalone Server.
    1. Run from inetd.
      1. Edit the /etc/proftpd.conf file so that ServerType is set to inetd like the following line:
           ServerType                      inetd
        
      2. For the machine to run from inetd you need to add or uncomment the following line in /etc/inetd.conf.
         ftp stream tcp  nowait  root  /usr/sbin/tcpd  /usr/local/sbin/proftpd
        
      3. Now restart the inetd daemon.
           # ps x | grep inetd
           11040 ?        S      0:00 /usr/sbin/inetd
           # kill -HUP 11040
        
    2. Run as a standalone.
      1. Edit the /etc/proftpd.conf file so that ServerType is set to standalone like the following line:
           ServerType                      standalone
        
      2. Change to /etc/rc.d and create a new file call proftp; edit it as follows:
          # cd /etc/rc.d
          # vi proftp
          
          
          ----------------proftp file cut below---------------------
          #!/bin/sh
          
          if [ -x /usr/local/sbin/proftpd ]; then
            /usr/local/sbin/proftpd
            echo "Starting Proftpd "
          fi
          # End script
          ----------------proftp file cut above---------------------
          
        
      3. Make the file executable and make a symbolic link in the appropriate run level to start and stop with run (init) levels.
           # chmod 700 proftp
           # cd rc3.d
           # ln -s ../proftp S15ProFTP
           # ln -s ../proftp K15ProFTP
        
BACK