Usually software which is called from your shell doesn't know about about Tor or any other proxy. So you have to tell it. The bad thing is that many software has specific ways to set a proxy up. Below you find some ways to get Tor working on commandline. I assume that you run a combination of Tor and Privoxy at the IP address 127.0.0.1 and port 8118. This might not true in your case. So you should enter the correct values.
Proxy environment variable
There is a special environment variable which is respected by some shell software. Open your .bashrc
(or other shell rc file) and enter the following lines.
export http_proxy="http://127.0.0.1:8118"
export https_proxy=${http_proxy}
export HTTP_PROXY=${http_proxy}
export HTTPS_PROXY=${http_proxy}
Applications like wget, GnuPG and curl are known to respect those values.
torsocks
Torsocks is a helper software with re-routes all requests through Tor. Just prepend the software to any command line call.
torsocks your-shellscript
torsocks wget http://example.org
Furthermore you can also use tor-resolve
to get an IP address through Tor.
tor-resolve example.org
torsocks ssh $(tor-resolve my.server.example.org)
SSH
If you're using SSH, you can edit your $HOME/.ssh/config
.
Host *
ProxyCommand socat STDIO SOCKS4A:127.0.0.1:%h:%p,socksport=9050
This setting sends every SSH connection through Tor. However the keyword Host
in ssh_config
allows you to set it up for special hosts. Please have a look at the manpage of ssh_config
.
Further ressources
The TorifyHOWTO at Torproject.org has advice for setting up different services. The toraliases
might also give some hints and has a setup for IPtables.
Best Answer
For tor daemon running on Ubuntu, first try this:
If that does not work, enable the control port in your torrc file.
Then, set a password for the control port with
tor --hash-password password
Open a telnet connection to the control port and issue the NEWNYM command:
sources: