Add to Favourites Add to Favourites    Print this Article Print this Article

How to install mod_sftp into proftpd

For any server admins who wish to allow their Users to upload data using sftp, instead of ftp or ftps, this guide will outline how to install sftp (secure shell ftp) into proftpd.

Note, this assumes you're using the newer unified_ftp_password_file setup for proftpd (you should hae an empty proftpd.vhosts.conf file)

  1. Recompile proftpd with the required changes:

    cd /usr/local/directadmin/custombuild
    ./build update
    ./build set ftpd proftpd
    mkdir -p custom/proftpd/conf
    wget -O custom/proftpd/configure.proftpd http://files.directadmin.com/services/all/sftp/configure.proftpd.sftp
    wget -O custom/proftpd/conf/proftpd.conf http://files.directadmin.com/services/all/sftp/proftpd.conf
    chmod 755 custom/proftpd/configure.proftpd
    wget -O /etc/proftpd.sftp.conf http://files.directadmin.com/services/all/sftp/proftpd.sftp.conf
    ./build proftpd

  2. Restart proftpd and test (bold items are typed)

    [root@server ~]#service proftpd restart
    Shutting down proftpd:                                     [  OK  ]
    Starting proftpd:                                          [  OK  ]
    [root@server ~]# telnet localhost 21
    Trying 127.0.0.1...
    Connected to localhost.localdomain (127.0.0.1).
    Escape character is '^]'.
    220 ProFTPD 1.3.4a Server ready.
    QUIT
    221 Goodbye.
    Connection closed by foreign host.
    [root@server ~]# telnet localhost 23
    Trying 127.0.0.1...
    Connected to localhost.localdomain (127.0.0.1).
    Escape character is '^]'.
    SSH-2.0-mod_sftp/0.9.8
    garbledtext
           Connection closed by foreign host.


Note, the default for sftp clients is to use port 22.  However, sshd uses this port by default.
If you want sftp to use 22, you'd first need to change the port that sshd is using (ensure your firewall is open on the new port), then change the Port 23 value in the /etc/proftpd.sftp.conf file to use 22 instead, then restart proftpd.


CustomBuild 2.0
If you need ClamAV, CB2 will automatically add this to the proftpd.conf while it's being installed.  As such, you'd also need to run:

cd /usr/local/directadmin/custombuild
mkdir -p custom/proftpd/conf
wget -O custom/proftpd/conf/proftpd.conf http://files.directadmin.com/services/all/sftp/proftpd.conf
./build proftpd

and it should copy the custom proftpd.conf, and also add the ClamAV parts to the
Was this answer helpful?

Also Read