To set a password for accessing a folder, go to "Directory Privacy" in your cPanel:
Specify the folder for which you want to set authorization.
Click the folder icon to navigate to the desired folder.
To set folder authorization, click "Edit":
Provide the authorization credentials for accessing this folder and click "Save".