htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users.
On Ubuntu server, you can install htpasswd with command
apt -y install apache2-utils
To create a password file and add user, run
htpasswd -b -c /etc/squid/passwd USERNAME_HERE PASSWORD_HERE
In above example, it create a file /etc/squid/passwd and add specified user and password.
-c == create password file. If already exits, overwrite it.
-b == get password from command line.
Add a user to existing passwd file.
You can run above command with out -c option. This will add new user to existing passwd file.
htpasswd -b /etc/squid/passwd USERNAME_HERE PASSWORD_HERE