1 install squid
Sudo apt-Get install squid
2. Install htpasswd (skip this step if Apache is installed)
(This is used to generate a password)
Sudo apt-Get install apache2-utils
Yes.
Sudo apt-Get install mini-HTTPd
3. Generate a password file
Htpasswd-C/etc/squid/passwd user1
You will be asked to enter the user1 Password
4. Change the permission to ensure that squid can read the password file.
SudoChmod o + R/etc/squid/passwd
5. Modify squid. conf to add or modify it to the following figure.
Auth_param BASIC Program/usr/lib/squid/ncsa_auth/etc/squid/passwd
Auth_param basic children 5
Auth_param basic realm Squid proxy-caching Web Server
Auth_param basic credentialsttl 2 hours
Auth_param basic casesensitive off
ACL ncsa_users proxy_auth required
Http_access allow ncsa_users
6 restart squid
Sudo/etc/init. d/squid restart
Done!
If you do not have htpasswd, you do not want to install htpasswd. You can also run CP on another machine to obtain a password file.