Running squid as user on Debian

Install the required packages:

$ sudo apt-get install squid fakeroot

Create the $HOME/.squid/squid.conf file:

http_port 127.0.0.1:3128
pid_filename none
cache_peer 10.2.10.1 parent 3128 0 login=mylogin:mypassword no-query connect-timeout=100 proxy-only
cache_dir ufs @HOME@/.squid/cache 100 16 256
cache_log @HOME@/.squid/cache.log
access_log @HOME@/.squid/access.log
http_access allow all
never_direct allow all
http_reply_access allow all
forwarded_for delete

Replace @HOME@ by your home directory, don’t use $HOME as this is not a shell script. Add what you want from /etc/squid/squid.conf or https://www.visolve.com/squid/squid30/contents.html.

Create cache directories:

$ fakeroot /usr/sbin/squid -f $HOME/.squid/squid.conf -z -N

To run it normally just do:

$ fakeroot /usr/sbin/squid -f $HOME/.squid/squid.conf -N

I’m using squid as a flexible alternative to cntlm.

#debian, #network, #squid