Select the Password Protect Directories icon from your cPanel main page. A list of the directories on your account will appear.
Select the directory you wish to limit access to. In the new page, please create a username and a password for your user. Select a name that will appear in the login screen and click on the Save button to activate the protection.
Please note that you have to create a directory before you enable the password protection for it. Also, using one and the same directory for the purpose of password protection and FTP storage at the same time is not recommended.
It is also important to add that password-protecting your webroot (the www directory) will lead to inability of your website to be displayed directly.