How to install mod_sftp into proftpd

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » Ftp

How to install mod_sftp into proftpdLast Modified: Mar 28, 2015, 2:59 pm
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 proftpd yes
mkdir -p custom/proftpd
wget -O custom/proftpd/configure.proftpd
chmod 755 custom/proftpd/configure.proftpd
./build proftpd

2) Backup old configs, and grab new ones:

cd /etc
cp proftpd.conf proftpd.conf.backup
wget -O proftpd.conf
wget -O proftpd.sftp.conf
perl -pi -e 's/\|SERVER_IP\|/' proftpd.conf
perl -pi -e 's/\|SERVER_IP\|/' proftpd.sftp.conf

where you'd replace with your server IP.

3) Restart proftpd and test (bold items are typed)

[root@server ~]#/etc/init.d/proftpd restart
Shutting down proftpd:                                     [  OK  ]
Starting proftpd:                                          [  OK  ]
[root@server ~]# telnet localhost 21
Connected to localhost.localdomain (
Escape character is '^]'.
220 ProFTPD 1.3.4a Server ready.
221 Goodbye.
Connection closed by foreign host.
[root@server ~]# telnet localhost 23
Connected to localhost.localdomain (
Escape character is '^]'.
       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
./build proftpd

and it should copy the custom proftpd.conf, and also add the ClamAV parts to the <Global> Section.

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST