How to Setup the SFTP Server on Fedora Linux
Let’s begin by updating the Fedora system as per the latest updates available:
Now, run the following command to install the OpenSSH server in the system:
Once you install the OpenSSH server, start the SSH service and enable it to start automatically at boot:
sudo systemctl enable sshd
sudo systemctl status sshd
To configure the SFTP access, edit the SSH server configuration file:
In this config file, uncomment the following line:
If you want to restrict the SFTP access to specific users or groups, add these lines at the end of the file:
ChrootDirectory /home/%u
ForceCommand internal-sftp
AllowTcpForwarding no
PasswordAuthentication yes
This configuration restricts the SFTP access to the users belonging to the “sftpTEAM” group, chroots them to their home directories, and enforces SFTP only. If needed, create an SFTP-only group to which you can add the users:
To grant the SFTP access to specific users, add them to the “sftpTEAM” group (or any other group you created):
After configuring the SSH server, restart the SSH service to apply the changes:
Your SFTP server is now set up on Fedora Linux. Users in the specified group (e.g., “sftpTEAM”) can securely transfer the files to and from their home directories using SFTP. Ensure that the user permissions and access control meet your security requirements.
Conclusion
This is all about the brief method that you can use while setting up the SFTP server on Fedora Linux with no hassles. The SFTP server ensures the secure file transfer with diverse user permissions. Hence, we recommend you to add only the specific users on your server, or you may face privacy and security-related issues. Moreover, you can easily create groups to handle the user permissions.