Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I use an SSH client over Tor in Ubuntu 11.10? I already have Tor running (and successfully anonymizing HTTP traffic).

share|improve this question


Add the following block to the top of your ~/.ssh/config file.

Host *
CheckHostIP no
Compression yes
Protocol 2
ProxyCommand connect -4 -S localhost:9050 $(tor-resolve %h localhost:9050) %p
share|improve this answer
You need to install package connect-proxy for this to work (source: – sup Feb 26 '13 at 0:44

With Tor running, you can use torify command. Eg:

torify ssh user@remotehost
torify curl
share|improve this answer

Use proxychains for it. It comes preconfigured to use a local tor proxy. Also you might want to avoid using DNS names on such activities as those might resolve the IP outside of tor, which is unwanted. (Thugh I hadn't checked if this is the case or not when using proxychains out of the box.)

share|improve this answer

If torify fails on your platform then try this :

Install connect in your path, maybe by building connect.c from source.

Create a script called ssh-tbb :

exec ssh -o ProxyCommand="connect -5 -S %h %p" $*

You could make other programs like git work by creating scripts like this git-tbb one :

export GIT_SSH=`which ssh-tbb` git pull
exec git $*

Rename them to -tor if you change the port to 9050 for the default tor config, as opposed to TBB's default 9150.

share|improve this answer
What is "connect"? What is "TBB"? – argentpepper Oct 29 '14 at 17:04
ssh-proxy's connect.c is here : – Jeff Burdges Apr 2 '15 at 17:15
TBB stands for Tor Browser Bundle. TBB's tor daemon runs on port 9150, while a system tor daemon runs on port 9050 by default. – Jeff Burdges Apr 2 '15 at 17:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.