How to Setup SFTP Server on Rocky Linux 9

To set up an SFTP server on Rocky Linux 9, follow the steps below.

Step 1 : Ensure that the SSH server is installed and running:

Step 2 : Open the SSH daemon configuration file:

Add or modify the following line to enable password authentication:

Add the following lines at the end of the file:

Save and exit the editor.

Step 3 : Restart the SSH daemon to apply the changes:

Step 4 : Create a group for SFTP users:

Step 5 : Add a new user for SFTP:

Step 6 : Set a password for the SFTP user:

Step 7 : Add the user to the SFTP group:

Step 8 : Ensure proper permissions for the SFTP user's home directory:

Step 9 : Restart the SSH service for changes to take effect:

Step 10 : Test Connection with SFTP Client (e.g., FileZilla)

- Open FileZilla.

- Add a new site.

  • Enter the host (IP or domain).
  • Select "SFTP - SSH File Transfer Protocol."
  • Set the port to 22.
  • Choose "Normal," and enter the SFTP username and password.

- Click "Connect."

Congratulations! You have successfully set up an SFTP server on Rocky Linux 9, allowing secure file transfers over SSH.