torsocks ssh does not work on Mac Sierra

1

I am trying to make an anonymous connection via ssh to a remote server using torsocks on my Macbook pro running Sierra, but it does not work.

I tried:

torsocks ssh root@THEIP

AND

ssh -L 9050:127.0.0.1:9050 root@THEIP

AND

ssh -o ProxyCommand="nc -X 4 -x localhost:9050 %h %p" root@THEIP

The very last command also throws an error: ssh_exchange_identification: Connection closed by remote host

While the other two commands work, when I am inside the remote server and I type who I am getting my real IP address, so I am assuming torsocks is not working.

What's wrong?

Anonymous

Posted 2016-10-08T19:51:26.377

Reputation: 131

Answers

2

Torsocks works by DYLD injection. As of 10.11 this kind of modification will be disallowed by a new feature called "System Integrity Protection". It is also known as "Rootless". The feature prevents both modifications to your system files, and to system processes whilst they are running (even if you enter your password for administrator access).

So on a normally configured Mac, torsocks cannot run with binaries in the /usr/* directory.

You can actually turn System Integrity Protection off. To do so, you must reboot into recovery mode (it is not meant as an operation a regular user would do).

From terminal in recovery mode run: csrutil disable;

Drive By Answer

Posted 2016-10-08T19:51:26.377

Reputation: 21

0

The issue is most likely that tor is simply not running.

Make sure that tor is installed and started as a background service.

Do you have tor installed? I recommend brew install tor and then brew services start tor. If you don't have home-brew install then go to brew.is and follow the command to get it setup (it is one line of code to run).

Once you confirm that tor is running, then retry your command and that you do it.

James Campbell

Posted 2016-10-08T19:51:26.377

Reputation: 103

@fixer1234 updated answer to make it an answer – James Campbell – 2016-11-09T21:57:56.377

-2

Check this:

ssh -o ProxyCommand='nc -x 0:9050 %h %p' root@ldeuiasdasd5v3b3lw.onion

tidnab

Posted 2016-10-08T19:51:26.377

Reputation: 1

1Can you explain how this differs from the command that the OP already tried, and why you believe that it is more likely to work?   Please do not respond in comments; [edit] your answer to make it clearer and more complete. – Scott – 2019-04-08T20:30:28.690