torsocks on MacOS: {binary} is protected by System Integrity Protection

After very long time I recently moved from Ubuntu to MacOS. That’s a big switch, which involves time in changing personal habits and restoring the old features…

Among one of them I constantly use Tor. Not that I have anything to hide, it’s mostly for fun and sometimes for work, where I need to escape restrictive firewalls to access outside network. I mostly need ssh to connect to the office, and to tunnel the connection though Tor I prefix the command with torsocks.

So after installing Tor using Homebrew I run the command and:


ERROR: /usr/bin/ssh is located in a directory protected by Apple's System Integrity Protection.

From what I could get, Apple’s SIP is the local SELinux/AppArmor. The message is produced by torsocks itself, and according to the related bug report:

Apple’s system integrity prevention also prevents users from injecting shared libraries into some binaries. This could be a cause of this issue. (And if this is the case, there may be nothing we can do to fix this.)

Luckily I found a lame workaround. According to the message, the command is placed in a directory protected by SIP. So what happens when running the command outside that directory?

At first I tried making a link:


ln -s /usr/bin/ssh /usr/local/bin

but this didn’t work. There was no error but ssh was unable to connect. So the more lame test


cp /usr/bin/ssh /usr/local/bin

and… Success!

So, as long as Tor devs cannot find a solution I’m still able to ssh through Tor.

Articoli recenti

Commenti recenti

Archivi

Categorie

maxxer Written by:

One Comment

  1. Yaaaaa
    20 aprile 2018
    Reply

    Thanks for the copy method 🙂

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *