Hi Alex,
Many thanks your investigation I was experiencing the exact same problem and was going crazy trying to find out what was causing it. My sFTP connection would also stop working after about 8 hours, a restart of the proftpd daemon solved it but only temporary until the same problem occurred again, I'll apply this patch to fix the issue properly.
Edit: Here's my way of patching and installing on CentOS 6.4:
1. Decompress the proftpd-1.3.4c.tar.gz at
/usr/local/directadmin/custombuild:
Code:
tar zxf proftpd-1.3.4c.tar.gz
2. You'll then have a folder called proftpd-1.3.4c within the custombuild folder. Switch into it:
3. Run the patch file with:
Code:
patch -p0 < /path/to/patchfile
It will fail on a couple of lines, but they are non issues and won't affect anything.
4. Now run ./configure but make sure you use these properties. These are the paths for CentOS/Redhat for FreeBSD and other you may have to modify them:
Code:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run --mandir=/usr/share/man --without-pam --disable-auth-pam --enable-nls --with-modules=mod_ratio:mod_readme:mod_sftp
5. Now compile and install the patched version of ProFTPD 1.3.4c with the SFTP fixes:
6. Finally restart ProFTPD with:
Use the variant for restarting daemons applicable to your Server OS if your not running Redhat/CentOS
You should be now running the patched version ProFTPD 1.3.4c. Connect to SFTP with a FTP client to first confirm SFTP is working, and to finally confirm the patch is working run:
Code:
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null`
Now try and reconnect to the SFTP. You should be able to connect again with no problems. (The broken 1.3.4c binaries would stop allowing SFTP connections at this point).
Hope this helps.