Saturday, July 5, 2014

Tor in Ubuntu 14.04

Earlier I had written how to use tor with Ubuntu 12.04and 11.10 . Those methods have become pretty outdated. With the recent versions of tor browser bundle the process of setting up tor is simpler. But to use use tor with other applications you need to still a bit of tweaking.

1. Set up tor browser bundle

The first step is to download tor browser bundle
and extract it. Tor can be launched by running start-tor-browser
script in extracted directory. If permission is denied then run "chmod
-R a+x * in a terminal to add executable bit to the files. During first
run, set the proxy settings and exit tor. Start tor again. Once the connection is established tor browser will come automatically.
This is a tweaked version of firefox. By default, add-ons and other
extensions are disabled. If you want to use tor just for browsing rest of the steps are irrelevant for you.

2. Find out the Control and Socks Port

Inside the tor browser bundle directory there is a Data/Tor directory which contains the torrc-defaults file. The Control and SocksPort are present in the file. In my case it is as follows :

SocksPort 9150
ControlPort 9151

3. Socks proxy

Your socks proxy will be 127.0.0.1:SocksPort. In my case it is 127.0.0.1:9151. This can be set as the proxy in any application to use it under socks proxy provided by tor.

4. Setting up http and https proxy for tor

4.1 For this install polipo and make sure that privoxy is not installed.

4.2 Use sudo visudo and add the following lines at the end of file:

4.3 Using editor command sudo gedit /etc/polipo/configreplace the contents of /etc/polipo/config with the following content. Make sure that 9150 is replaced with your Socks Port found in step 3.

4.4 Restart polipo.

4.5 Set polipo not to start by default

We have to remove the polipo service from startup. For that sudo apt-get install sysv-rc-conf. After installation run sudo sysv-rc-conf. It will display a table , scroll down by the use of arrow key to the line with polipo and disable all selections by the use of space key. sysv-rc-conf can be quit by using the key q.

Now u can use the proxy 127.0.0.1:8118 as http, https and ftp proxies under tor. After tor connects run 'sudo service polipo start' to start the polipo service.

5. To use tor in firefox follow either steps

a) Set the proxy to

http , https and ftp 127.0.0.1:8118

socks host 127.0.0.1:9150

bc) Use foxyproxy for custom proxy management

use
27.0.0.1:8118 and other proxies in a mixed manner specifying custom
patterns in urls. (I prefer this method ).

6. For torrent use the client vuze. and set the http or socks proxy.

7. Using tor from Virtual machine.

If
you are using virtualbox then we can use the host tor network in the
guest os. For that set all proxy in guest OS as : 10.0.2.2:8188

HiThank you for this blog, very useful !I follow your explanation (MINT 17, office 2007) and it finally works !! Yipiiii !

But :when i close word 2007, i've got the error http://cjoint.com/?DJvt1dTBUcmI tried to disabled this dialog :in winetricks > "Change settings" > i check : "nocrashdialog" but this has no effect and when i launch again winetricks, the checkbox is uncheck...

ThanksHervé

PS : in your step 6. , is it just "riched20.dll" in "native" or all the items (there are 22)

my second comment is also removed, I don't understand! may be It's relative to the length of the message! I have a problem with step 7, I can not install Office 2010 on my Ubuntu 14.04 64 bits even if all the steps were successful! I got errors like :

Even though I got the winecfg applet and I added from above winetricks command libraries the ones that I found (riched20, msxml6, gdiplus) ; after that I wrote the command bellow which returned an error

root@mohammed-Inspiron-5537:/home/mohammed# cd ./Office2010root@mohammed-Inspiron-5537:/home/mohammed/Office2010# wine setup.exewine: /home/mohammed/.wineprefixes/office2010 is not owned by you

Then I applied the chown -R mohammed:mohammed ~/.wine after which I re tried and got the same message : wine: /home/mohammed/.wineprefixes/office2010 is not owned by you

I do not understand anything (that's absurd especially after chaging the owner of .wine )! can you help me out?

I've tried at first as a normal user as I esplained, then I got the message that I am not the owner of .wine, so I tried as root. Now, I tried what you suggested (delete the .wine and the .wineprefixes and started again from step 4), and these are the errors I am getting now in step 5 :mohammed@mohammed-Inspiron-5537:~$ winetricks vcrun2008 dotnet20 dotnet40 msxml6 riched20 riched30 gdiplus ------------------------------------------------------wine cmd.exe /c echo '%ProgramFiles%' returned unexpanded string '%ProgramFiles%' ... can be caused a corrupt wineprefix, an old wine, or by not owning /home/mohammed/.wineprefixes/office2010/------------------------------------------------------mohammed@mohammed-Inspiron-5537:~$ chown -R mohammed:mohammed /home/mohammed/.wineprefixes/office2010/mohammed@mohammed-Inspiron-5537:~$ winetricks vcrun2008 dotnet20 dotnet40 msxml6 riched20 riched30 gdiplus ------------------------------------------------------wine cmd.exe /c echo '%ProgramFiles%' returned unexpanded string '%ProgramFiles%' ... can be caused a corrupt wineprefix, an old wine, or by not owning /home/mohammed/.wineprefixes/office2010/