To setup an SFTP server on CentOS 7, follow these steps.
Step 1 : Ensure SSH daemon is running:
Step 2 : Open SSH configuration:
Add the following lines at the end of the file to configure SFTP:
- Set password authentication:
Step 3 : Restart the SSH service to apply the changes:
Step 4 : Create a new group for SFTP users:
Step 5 : Add a new user to the system:
Step 6 : Set a password for the newly created user:
Step 7 : Add the user to the SFTP group:
Step 8 : Set the appropriate permissions for the user's home directory:
Step 9 : Restart the SSH service once more to ensure all changes take effect:
Step 10 : Test Connect
- Open FileZilla or your preferred SFTP client.
- In FileZilla, go to "File" -> "Site Manager" and click "New Site".
- Enter the IP address or hostname of your CentOS 7 server in the "Host" field.
- Set the protocol to "SFTP - SSH File Transfer Protocol".
- Ensure the port is set to 22.
- Select "Normal" as the logon type, and enter the username and password you created earlier.
- Click "Connect"
Congratulations! You have successfully set up an SFTP server on CentOS 7.