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: May 19, 2012, 7:53 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 http://files1.directadmin.com/services/all/sftp/configure.proftpd.sftp
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 http://files1.directadmin.com/services/all/sftp/proftpd.conf
wget -O proftpd.sftp.conf http://files1.directadmin.com/services/all/sftp/proftpd.sftp.conf
perl -pi -e 's/\|SERVER_IP\|/1.2.3.4/' proftpd.conf
perl -pi -e 's/\|SERVER_IP\|/1.2.3.4/' proftpd.sftp.conf

where you'd replace 1.2.3.4 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
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.

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