How to install & configure tor, vidalia, privoxy, & polipo privacy software on Centos 6

Support for security such as Firewalls and securing linux
Post Reply
Rocksockdoc
Posts: 414
Joined: 2012/03/29 20:12:28

How to install & configure tor, vidalia, privoxy, & polipo privacy software on Centos 6

Post by Rocksockdoc » 2012/11/25 05:58:12

The question is how does one install and configure a typical installation of tor, vidalia, polipo, and privoxy on Centos 6.

1. Privoxy installed and started easily via
[code]
$ sudo yum install privoxy
REPORTS: privoxy x86_64 3.0.16-6.2.el6 @epel
$ sudo service privoxy start
REPORTS: privoxy --pidfile /var/run/privoxy.pid --user privoxy /etc/privoxy/config
[/code]

2. Firefox was easily configured for privoxy using the commands below:
[code]
Edit->Preferences->Advanced->Network->Settings->(o)Manual proxy configuration
[ ]Use the same proxy service for all protocols (unchecked)
HTTP Proxy:127.0.0.1 Port:8118
SSL Proxy:127.0.0.1 Port:8118
(o)Socks v5
Change from: No Proxy for: localhost, 127.0.0.1 to <blank>
[/code]

3. Polipo installed easily:
[code]
$ sudo yum install polipo"
REPORTS: polipo x86_64 1.0.4.1-2.el6 @epel
$ sudo service polipo start
REPORTS: /usr/bin/polipo -c /etc/polipo/config
[/code]

4. I haven't yet configured polipo but this [url=http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/faq.html#tor]polipo FAQ[/url] explains (confusingly) how to set polipo up with privoxy (Note: [url=http://forums.debian.net/viewtopic.php?f=16&t=66500]This Debian page does a (much) better job explaining how to set up polipo with privoxy[/url]).
[code]
To run Polipo with Privoxy:
Point Firefox at Privoxy (localhost:8118) as shown in step #2 above.
Point Privoxy at Polipo by adding the following line to the Privoxy config file:
forward / localhost:8123
use no parent proxy in Polipo.
To run polipo with Tor, set the socksParentProxy to localhost:9050 by uncommenting the lines below in the Privoxy config file:
# socksParentProxy = "localhost:9050"
# socksProxyType = socks5
Note: One way to tweak Privoxy is to temperarily change the following line FROM:
enable-edit-actions 0
TO:
enable-edit-actions 1
Then in your browser (set the http proxy to localhost:8118), and type p.p or http://config.privoxy.org to reach the web interface.
From there you can make changes to Privoxy through the web interface.
Simply change the 1 back to a 0 in the /etc/privoxy/config file when you are done.
[/code]

5. However, Tor & Vidalia do not seem to install as easily as did privoxy & polipo.

Searching this forum web site for "how to install Tor Vidalia" surprisingly came up empty.
Running this set of commands also came up empty:
$ yum --noplugins --showduplicates --enablerepo \* --disablerepo c6-media,\*-source,\*debug\* provides "*/tor"
$ yum --noplugins --showduplicates --enablerepo \* --disablerepo c6-media,\*-source,\*debug\* provides "*/vidalia"

Googling, I find this web page which describes [url=http://solutiontribe.blogspot.com/2012/06/install-and-configure-tor-brigdes-on.html]Tor installation on Centos[/url] and a similar web page titled [url=https://www.torproject.org/docs/rpms.html.en]"Tor packages for RPM-based linux distributions"[/url] and yet another similar web page titled [url=http://portalbuilders.pro/PBblog/anonymous-web-browsing-installing-tor-polipo-and-vidalia-on-fedora/]"Anonymous Web Browsing: Installing Tor, Polipo, and Vidalia on Fedora"[/url]. But, I also find instructions for running the [url=https://www.torproject.org/projects/torbrowser.html.en]"Tor Browser Bundle"[/url] which state this downloadable file is "[i][url=https://www.torproject.org/download/download-easy.html.en]Everything you need to safely browse the Internet. This package requires no installation. Just extract it and run[/url][/i]."

Before I (arbitrarily?) choose one of those routes above, may I ask what the recommended procedure is for installing the Tor/Vidalia bundle on Centos 6?

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

How to install & configure tor, vidalia, privoxy, & polipo p

Post by AlanBartlett » 2012/11/25 19:08:40

A quick reply, as I do not have the time to read those links.

My preference would be to study the information provided in the the first three links and disregard the fourth. The second link would be my starting point and I would be looking for pre-built packages for usage on [b]RHEL 6[/b].

Rocksockdoc
Posts: 414
Joined: 2012/03/29 20:12:28

Re: How to install & configure tor, vidalia, privoxy, & polipo privacy software on Centos 6

Post by Rocksockdoc » 2012/11/26 22:15:05

[quote]
AlanBartlett wrote:
The second link would be my starting point and I would be looking for pre-built packages for usage on [b]RHEL 6[/b].[/quote]

Thanks Alan. It seems I must be the only one installing lots of software for Centos 6 that nobody else seems to be using!

I'll write up below how I installed the following common privacy solutions specifically so that the next person can stand on our shoulders.
A. Privoxy/Polipo services (can anonymize & manage browser cache)
B. Tor Browser Bundle (easy to use pre-configured Firefox anonymizer)
C. Tor/Vidalia (can be used to torify socks applications)
D. Torsocks/socat (can be used to torify non-socks applications)

If you see me make any mistakes, please point them out so that others follow best in our footsteps.

As noted, the various instructions conflicted with each other - so I simply chose 'the best' option "I could find" for Centos 6 (64 bit X86).

0. I first read up on the [url=https://www.torproject.org/docs/rpms.html.en]Tor packages for RPM-based linux distributions[/url]

1. I created a new file in the yum repository:
[code]
$ sudo vi /etc/yum.repos.d/torproject.repo
CONTAINING:
[tor]
name=Tor experimental repo
enabled=1
baseurl=http://deb.torproject.org/torproject.org/rpm/el/6/$basearch/
gpgcheck=1
gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc

[tor-source]
name=Tor experimental source repo
enabled=1
autorefresh=0
baseurl=http://deb.torproject.org/torproject.org/rpm/el/6/SRPMS
gpgcheck=1
gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
[/code]

2. I used YUM to install Tor using that newly added repo:
[code]
$ sudo yum install tor
[/code]

3. I started the Tor service:
[code]
$ sudo service tor start
[/code]

4. I learned how to configure my applications for Tor as per this web page:
[url=https://www.torproject.org/docs/tor-doc-unix.html.en#using]Running the Tor client on Linux/BSD/Unix[/url]
But I mostly followed this web page:
https://www.torproject.org/docs/tor-doc-web

5. I tested to see if my browser was configured for Tor:
https://check.torproject.org

[b]So that others benefit, here's how I additionally installed the stand-alone Tor Browser Bundle:[/b]
a) Obtain the standalone pre-configured Tor & Vidalia browser bundle (TBB)
https://www.torproject.org/projects/torbrowser.html.en
Note: This bundle contains Tor, Vidalia, and a pre-configured Firefox browser.

b) Extract and run the script to start the Tor browser:
/path/tor-browser_en-US/start-tor-browser

c) Test if the browser is configured to use tor:
https://check.torproject.org

[b]Again, for others, here's how I installed & set up Privoxy with Firefox:[/b]
0. Read about installing Privixy on Debian here (I couldn't find any usable Centos-specific help):
http://forums.debian.net/viewtopic.php?f=16&t=66500

1. Install privoxy x86_64 3.0.16-6.2.el6 @epel
[code]
$ sudo yum install privoxy (worked just fine from epel)
[/code]

2. Make a copy of the privoxy configuration file:
[code]
$ cp /etc/privoxy/config /etc/privoxy/config.original
[/code]

3. Add this next line to chain privoxy to polipo:
[code]
$ sudo vi /etc/privoxy/config
ADD:
forward / localhost:8123
[/code]

4. To tweak privoxy, temporarily change the enable-edit-actions switch:
[code]
$ sudo vi /etc/privoxy/config
CHANGE FROM:
enable-edit-actions 0
CHANGE TO:
enable-edit-actions 1
[/code]
Then in your browser (set the http proxy to localhost:8118),
type p.p or http://config.privoxy.org to reach the web interface.

Change the 1 back to a 0 in the /etc/privoxy/config file when you are done.
You do not have to restart the process for settings to take effect.

5. Set up Firefox to point to privoxy:
Edit->Preferences->Advanced->Network->Settings->(o)Manual proxy configuration
[ ]Use the same proxy service for all protocols (unchecked)
HTTP Proxy:127.0.0.1 Port:8118
SSL Proxy:127.0.0.1 Port:8118
(o)Socks v5
Change from: No Proxy for: localhost, 127.0.0.1 to
# sudo service privoxy start
This runs the following command:
privoxy --pidfile /var/run/privoxy.pid --user privoxy /etc/privoxy/config

6. Apparently you need to set up dnsmasq (DNS) as per this Debian DIY:
http://forums.debian.net/viewtopic.php?f=16&t=66500

7. Configure dnsmasq (DNS) dnsmasq x86_64 2.48-6.el6 @base
[code]
$ sudo copy /etc/dnsmasq.conf /etc/dnsmasq.conf.original
$ sudo vi /etc/dnsmasq.conf

Add the following line:
listen-address=127.0.0.1
Restart dnsmasq:
$ sudo /etc/init.d/dnsmasq restart
[/code]

[b]Here's how I installed & set up Polipo (web caching) with Firefox:[/b]
0. I didn't find good Centos 6 instructions so I used Debian instructions here:
http://forums.debian.net/viewtopic.php?f=16&t=66500

1. Install Polipo:
[code]
$ sudo yum install polipo
[/code]

2. Start the service:
[code]
$ sudo service polipo start
This runs the command: /usr/bin/polipo -c /etc/polipo/config
[/code]

3. Make a backup of the Polipo configuration file:
[code]
$sudo cp /etc/polipo/config /etc/polipo/config.original
[/code]

4. Modify the Polipo configuration file as needed:
[code]
$sudo vi /etc/polipo/config

Uncomment this line for a single-user system:
cacheIsShared = false

Add the following line:
dnsNameServer = 127.0.0.1
[/code]

5. Point Polipo to Tor:
[code]
Uncomment these two lines in the /etc/polipo/config file:
socksParentProxy = "localhost:9050"
socksProxyType = socks5
[/code]

6. Start the Polipo service:
[code]
$ sudo /etc/init.d/polipo stop
$ sudo /etc/init.d/polipo reload <=== this gave me an error (which may be due to the Debian instructions?)
$ sudo /etc/init.d/polipo start
[/code]

7. Use this URL to view the Polipo manual:
http://localhost:8123/doc/

[b]Tor will allow you to torrify socks applications; but you need torcat or socat to torify non-socks applications[/b]

0. Read how to torify TCP connections:
http://secdevel.blogspot.com/2011/01/torify-your-tcp-connection.html

1. Install socat x86_64 1.7.2.1-1.el6 epel
[code]
$ sudo yum install socat
[/code]

2. You (apparently) need to make sure your time is correct so install ntp x86_64 4.2.4p8-2.el6.centos base
[code]
sudo yum install ntp
[/code]

3. Start the Tor service and NTP service if necessary:
[code]
$ sudo service tor start
$ sudo ntpdate 0.centos.pool.ntp.org
$ sudo service ntp start
[/code]

4. I'm not sure what the next step is yet in order to torify socks & non-socks applications (other than web browsers).
I think I also need torsocks (in addition to socat):
https://code.google.com/p/torsocks/

Rocksockdoc
Posts: 414
Joined: 2012/03/29 20:12:28

Re: How to install & configure tor, vidalia, privoxy, & polipo privacy software on Centos 6

Post by Rocksockdoc » 2012/12/02 22:38:47

I was having all sorts of connection problems, so I tried removing the software above - but - without the net - I couldn't remove the software!
Catch-22!
- [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=40384&start=0#forumpost174667]Why does yum require the Internet for it to work in order to remove installed software?[/url]

The workaround, kindly supplied by Trevor, was:
[code]
$ sudo yum --disablerepo=\* remove polipo privoxy tor torsocks socat
[/code]

Post Reply