UPDATE: I found a more elegant way here.
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.
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
So, as long as Tor devs cannot find a solution I’m still able to ssh through Tor.