This article covers steps to setup and new SFTP server by making the ssh configuration changes, adding new users, and assigning the required directory permissions. You can add as many users as you want or simply create a new group and make new users part of that group.
FTP is a great protocol for accessing and transferring files, but it has the shortcoming of being a clear text protocol.
In other words, it's not secure to use over an internet connection, since your credentials and data are transmitted without encryption.
The 'S' in SFTP stands for 'Secure' and tunnels the FTP protocol through SSH, providing the encryption needed to establish a secure connection.
To Configure SSH daemon on Ubuntu:
1. SFTP requires SSH, so if SSH server is not already installed on your system, install it with the following command:
$ sudo apt install ssh
2. Once SSH is installed, we need to make some changes to the SSHD configuration file. Use nano or your favorite text editor to open it:
$ sudo nano /etc/ssh/sshd_config
3. Scroll to the bottom of the file and add the following 5 lines at the very end and save file:
Match group sftp
4. Restart the SSH service for these new changes to take effect:
$ sudo systemctl restart ssh