I'm having a hard time understanding why torsocks/torify isn't working in this particular case.
torify ssh user@remotemachine torsocks ssh user@remotemachine
When I do the following command when I get in my actual IP is printed:
echo $SSH_CLIENT # [my actual IP + remote/local ports]
But if I do
ssh -o ProxyCommand='nc -x localhost:9050 %h %p' user@remotemachine # 9050 being the SOCKSPort
then I get the tor ip. What gives? What am I missing about how torify/torsocks and/or ssh works?
Contents of torsocks.conf:
TorAddress 127.0.0.1 TorPort 9050 # matches tor's SOCKSPort
edit: I should mention that I'm on MacOS and cannot torify/torsocks /usr/bin/ssh directly since /usr/bin is protected by Apple's System Integrity Protection so I copy it into /tmp/ssh first. I don't imagine that would change anything but don't know what I don't know so...