I have followed these instruction to setup a SFTP server on an Ubuntu EC2 instance
But When I connect using filezilla using a keyfile I don't have write permission to the remote folder. If I add write permission for the group the user is in (chmod 775 Files) then I can add and remove files but if I disconnect I am unable to reconnect and get this error in Filezilla.
Error: Network error: Software caused connection abort
Error: Could not connect to server
In my /etc/ssh/sshd_config I have this line
ChrootDirectory /home/%u/Files
Here is what I do on the command line:
chmod 775 /home/christian/Files
After this I cant connect from Filezilla but if already connected can write to Files folder
If I do this instead:
chmod 755 /home/christian/Files
I can connect from Filezilla but cant write to Files folder.
How is it possible that adding write permission to the Files folder causes connection problems and what do I need to do to be able to connect and write to the server?
ChrootDirectory
a subdirectory of/home/%u
- my knowledge of SFTP jails is sketchy, but doesn't that mean/home/christian
needs to be owned byroot
? Also, as noted in the comments the installation ofvsftpd
is redundant (it provides FTPS, not SFTP) - not sure how much I'd trust a guide that confuses that.