title: Torify/torsocks ssh only working from device itself, and not from other devices
body: <p>While setting up ssh over tor I determined that the ssh only works from the device I try to access (<code>deviceA</code>), but not from another device (<code>deviceB</code>).</p>
  <p>I get a fresh install of Ubuntu Server 20.04 LTS, verify it is connected through wifi to the internet, completed the sudo apt update and upgrade commands successfully, rebooted successfully, and ran: <code>sudo apt install tor</code>. Next, I ran</p>
  <pre><code>sudo nano /etc/tor/torrc
  </code></pre>
  <p>and included:</p>
  <pre><code>HiddenServiceDir /var/lib/tor/other_hidden_service/
  HiddenServicePort 22
  </code></pre>
  <p>(so not <code>HiddenServicePort 22 127.0.0.1:22</code>)</p>
  <p>Next, I restarted the tor service using:</p>
  <pre><code>sudo systemctl restart tor
  </code></pre>
  <p>This was followed by getting the onion domain of the ssh server with:</p>
  <pre><code>sudo cat /var/lib/tor/other_hidden_service/hostname
  </code></pre>
  <p>which returned <code>someoniondomain.onion</code>.</p>
  <p>The next step was to ssh into <code>deviceA</code> from <code>deviceB</code>, so I copied, using a usb drive to prevent manual typos, the onion address for the ssh service to <code>deviceB</code>. On this <code>deviceB</code> I ran:</p>
  <pre><code>sudo apt install tor
  sudo apt install torify
  torify ssh ubuntu@someoniondomain.onion
  </code></pre>
  <p>Where <code>ubuntu</code> is the username of <code>deviceA</code>. This <code>torify</code> command returned:</p>
  <blockquote>
  <p>333333333 PERROR torsocks[28775]: socks5 libc connect: Connection refused (in socks5_connect() at socks5.c:202)
  ssh: connect to host someoniondomaion.onion port 22: Connection refused</p>
  </blockquote>
  <p>So I also ran <code>sudo systemctl restart tor</code> on <code>deviceB</code> in case that was not set up by torify, yet with the same output.</p>
  <p>However, when I run the same command from <code>deviceA</code> itself, it successfully ssh's into itself as is indicated by output:</p>
  <blockquote>
  <p>The authenthicity of host 'someoniondomain.onion (127.42.42.0)' can't be established.</p>
  <p>ECDSA key fingerprint is SHA256:.</p>
  <p>Are you sure you want to continue connecting (yes/no/[fingerprint])?</p>
  </blockquote>
  <h2>Notes</h2>
  <p>I did not change the <code>/etc/tor/torrsocks.conf</code> file, meaning it contains:</p>
  <pre><code>TorAddress 127.0.0.1
  TorPort 9050
  
  OnionAddrRange 127.42.42.0
  </code></pre>
  <p>My current guess is that the issue might be related to the <code>OnionAddrRange 127.42.42.0</code> line as <code>deviceA</code> and <code>deviceB</code> are on the same network, which might somehow cause an issue.</p>
  <h2>Question</h2>
  <p>How can I ensure I am also able to ssh into <code>deviceA</code> over tor from <code>deviceB</code>?</p>