Enable SFTP on LINUX server
How to enable SFTP (Secure File Transfer Protocol) at your LINUX server to make it accessible by for example: FILEZILLER (https://filezilla-project.org)
This tutorial was successful tested with System: Ubuntu 20.04.03 LTS Shell: bash
Create several tabs with open ssh connection, in case something went wrong and the ssh pipe gets broken and you need to reset ssh settings!
Let´s check if ssh is already running.
On your linux server you need to create a new user "sftpuser" as well as a group "sftp". we will specify this group as sftp user group.
Attention: if you add a user to the sftp group because the user will NOT be allowed to use SSH! In worst case you are logged out of your server. Do NOT add a sudo user that you are using to connect to your server to the sftp group!
On your linux server you need to create a new user "sftpuser" as well as a group "sftp". we will specify this group as sftp user group.
Now we need to modify the ssh configuration file and enable sftp. Add the following lines to the end of sshd_config
file.
Add these 5 lines to the end of sshd_config
To verify that the sshd_config
file is correct pls run
sudo sshd -t
if it retuns nothing everything is fine and we can restart the sshd.service
If you get some feedback / output / error from sudo sshd -t
Do not go on with the next step. In worst case ssh does not work properly and you are locked out of your server.
If you are using private and public key access (RSA) on ssh you propably need to copy authorized_keys
, known_hosts
into the sftpuser home folder /home/sftpuser/.ssh
Congratulations. Now you can try to connect over sftp from your local host via FileZiller.
Last updated