To setup an SFTP server on Ubuntu 24.04, follow the steps below:
Step 1 : Update System Packages.

Step 2 : Install openssh-server if not already installed.

Step 3 : Open sshd_config and add SFTP configuration.
Add or uncomment the following lines:

Step 4 : Restart ssh.

Step 5 : Create an SFTP group.

Step 6 : Create an SFTP User.

Step 7 : Assign the user to the SFTP group.

Step 8 : Configure Permissions

Step 9 : Allow traffic through UFW if enabled.

Step 10 : If you want to enable password login, configure sftp
Ensure the following line is uncommented:

Step 11 : Restart SSH Service.

Step 12 : Test Connection.
- Open your SFTP client (e.g., FileZilla).

- Add a new site
- Configure the settings:

- Host: Your server's IP address
- Port: 22
- Protocol: SFTP - SSH File Transfer Protocol
- Logon Type: Normal
- User: Your SFTP username
- Password: Your SFTP user's password

- Connect
Congratulations! You have successfully set up an SFTP server on Ubuntu 24.04.