I have started using the sftp module for proftpd and it works like charm.
In /etc/proftpd/modules.conf make sure LoadModule mod_sftp.c is commented out
Create the following file /etc/proftpd/conf.d/sftp.conf and copy the following config into it.
- <IfModule mod_sftp.c>
- <VirtualHost 0.0.0.0>
- SFTPEngine on
- Port 2222
- SFTPLog /var/log/proftpd/sftp.log
- # Configure both the RSA and DSA host keys, using the same host key
- # files that OpenSSH uses.
- SFTPHostKey /etc/ssh/ssh_host_rsa_key
- SFTPHostKey /etc/ssh/ssh_host_dsa_key
- # Enable compression
- SFTPCompression delayed
- # i-MSCP SQL Managment
- SQLBackend mysql
- SQLAuthTypes Crypt
- SQLAuthenticate on
- SQLConnectInfo imscpftpuser@localhost imscpftpuser XXXXXXXXXXX
- SQLUserInfo ftp_users userid passwd uid gid homedir shell
- SQLGroupInfo ftp_group groupname gid members
- SQLMinUserUID 1001
- SQLMinUserGID 1001
- DefaultRoot ~
- ShowSymlinks on
- AllowOverwrite on
- AllowStoreRestart on
- AllowForeignAddress on
- </VirtualHost>
- </IfModule>
Display More
Get the same credentials that imscp is using to authenticate users for ftp cat /etc/proftpd/proftpd.conf|grep SQLConnectInfo and user the credentials in the sftp.conf file under SQLConnectInfo.
Make sure tcp port 2222 is allowed in your firewall.
Restart proftpd.