SFTP Error - Couldn't read packet: Connection reset by peer

Solution 1:

cat /var/log/auth.log

May 10 17:08:32 machine sshd[31902]: fatal: bad ownership or modes for chroot directory component "/var/www/html/nextcloud/"

that was my problem

After we can follow this one bad ownership or modes for chroot directory component

BTW I end up using bind solution Need help - limit access to sftp user to other users home->subfolder

Solution 2:

You could use proftpd which offers a SFTP frontend. This way you can unite SFTP, FTP and FTP/S in one daemon. However you cannot use port 22 for SFTP or you'll have to give up on SSH on that port since proftpd and sshd cannot bind the same ports for SFTP.

Tags:

Sftp

Ssh