vsftpd - GnuTLS error -15: An unexpected TLS packet was received

Solution 1:

I tried adding a line to my configuration file. Open the config here:

sudo nano /etc/vsftpd.conf

And put this line at the bottom:

allow_writeable_chroot=YES

Afterwards, restart the service:

sudo service vsftpd restart

That fix it for me.

Solution 2:

May be you have an error that has no relation with SSL.

  1. Try to deactivate SSL (ssl_enable=NO)
  2. Connect with your favorite FTP client.

Then you probably see the real error.

That's why the Francisc I.B answer has no relation with SSL.

Solution 3:

I ran into this same issue. Another thread advises against setting allow_writeable_chroot=YES for security reasons, namely to mitigate a "ROARING BEAST ATTACK".

Setting allow_writeable_chroot=YES means that vsftpd should allow the situation where the user's home directory is writeable by that user. Instead for security reasons I changed the permissions on the user's root folder from 777 to 555.

Original: drwxrwxrwx /home/ftpuser/

Changed to: dr-xr-xr-x /home/ftpuser/

This made the user's home directory NOT writeable by the user and thus I didn't have to use the allow_writeable_chroot=YES parameter. This is fine (and more secure) for my situation as I have a preset directory structure and don't want the user making new files or directories in their root folder anyways.

I figured this out when I switched the home directory to /var/ftp via the local_root=[path] parameter for vsftpd and it worked without having to set allow_writeable_chroot=YES. This folder /var/ftp is (755) but owned by root and thus not writeable by ftpuser.