Create a ".htaccess" file (chmod 644, maximum) in the directory under public_html that you want to protect. The .htaccess file needs the following directives in it:
AuthType Basic
AuthName "Some Name Here"
AuthUserFile /home/yourusername/passwd
<Limit GET POST>
require valid-user
</Limit>
Of course, you need to replace "yourusername" with your actual username.
The next step is to connect to your account with SSH and from the shell prompt use the "htpasswd" command to add users and passwords to the /home/yourusername/passwd file. Just type "htpasswd" at the shell prompt for instructions on how to use that progra m.
The passwd file you create can be anywhere. But it should not be inside your public_html directory.