Solution for the beginners: Install And Configure SFTP Kodekloud
The description and validation on this task seem incorrect/incomplete.
Setting root:root
ownership and 755
permissions on /var/www/<folder>
does not allow sftp uploading, which seems like a reasonable use case. The question does not define whether uploading and or downloading is a requirement. I attempted this task 3 times and only passed when I used the strict download-only permissions.
I would recommend stating that /var/www/<folder>
should not allow uploads but that /var/www/<folder>/uploads
should allow uploads for the one user.
Honestly it would also be better to set this up requiring the use of groups (instead of just one user), which is a very common use case, and is cleaner in /etc/ssh/sshd_config
since you don’t have to define every single sftp user.