How can I setup the openSSH SFTP server on Linux?

Solution 1:

You need make sure /home/ftp is owned by root and that group and others don't have write permissions, e.g. chmod 0755. You need to add sub-directories for ftp to add files in.


You also need the internal-sftp subsystem, otherwise you need to provide a proper chroot environment in /home/ftp:

Subsystem sftp internal-sftp

To disallow all non-password kinds of login, enter

ChallengeResponseAuthentication no
GSSAPIAuthentication no
PubkeyAuthentication no

These are activated by default.