5

So before I flew several thousand miles away I installed Tor on my computer and setup a SSH hidden service. I sat upstairs and could access the machine through tor using a SSH config file and also locally (i.e. ssh [username]@192.168.100.118). (Because I didn't want to relive rlogging in to a machine across the Atlantic watching keystrokes appear on my terminal with the speed they did 20+ years ago.)

Both worked beautifully. Now I took my flight. Unfortunately I'm limited to public access points. I don't know if that is the issue. I'm getting

nc: connection failed, SOCKS error 4.
ssh_exchange_identification: Connection closed by remote host

Googling the first led me to a site which indicated SOCKS error 4 is "Host unreachable." I tried two things, both yielded the above results:

  1. ssh [hostname]

  2. ssh [username]@[hostname]

My .ssh/config file reads:

Host [hostname]
    HostName [.onion address]
    Compression yes
    Ciphers arcfour256,blowfish-cbc
    ProxyCommand nc -xlocalhost:9050 -X5 %h %p

I've used a local coffee shop and the public library. In a few weeks I'll be at a very low speed location (satellite link)... but should have complete access to the router. But the Tor browser seems to work without issue which makes me question if it's the router.

Any words of advice?

UPDATE Jens I actually did that shortly after posting and I didn't see anything, but I'm not sure exactly what to look for. Here is the output:

OpenSSH_6.6, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/nolan/.ssh/config
debug1: /home/nolan/.ssh/config line 1: Applying options for [hostname]
debug3: ciphers ok: [arcfour256,blowfish-cbc]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Hostname has changed; re-reading configuration
debug1: Reading configuration data /home/nolan/.ssh/config
debug3: ciphers ok: [arcfour256,blowfish-cbc]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Executing proxy command: exec nc -xlocalhost:9050 -X5 [my address].onion 22
debug1: permanently_drop_suid: 1000
debug1: identity file /home/nolan/.ssh/id_rsa type -1
debug1: identity file /home/nolan/.ssh/id_rsa-cert type -1
debug1: identity file /home/nolan/.ssh/id_dsa type -1
debug1: identity file /home/nolan/.ssh/id_dsa-cert type -1
debug1: identity file /home/nolan/.ssh/id_ecdsa type -1
debug1: identity file /home/nolan/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/nolan/.ssh/id_ed25519 type -1
debug1: identity file /home/nolan/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6p1 Ubuntu-2ubuntu1
nc: connection failed, SOCKS error 4
ssh_exchange_identification: Connection closed by remote host

Using 127.0.0.1 or localhost did not seem to affect anything.

My local log file for today:

Apr 29 14:29:14.000 [notice] Tor 0.2.4.27 (git-412e3f7dc9c6c01a) opening log file.
Apr 29 14:29:14.000 [notice] Parsing GEOIP IPv4 file /usr/share/tor/geoip.
Apr 29 14:29:14.000 [notice] Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
Apr 29 14:29:16.000 [notice] Bootstrapped 5%: Connecting to directory server.
Apr 29 14:29:16.000 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (Network is unreachable; NOROUTE; count 1; recommendation warn)
Apr 29 14:29:16.000 [notice] We now have enough directory information to build circuits.
Apr 29 14:29:16.000 [notice] Bootstrapped 80%: Connecting to the Tor network.
Apr 29 14:29:16.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to the Tor network. (Network is unreachable; NOROUTE; count 2; recommendation warn)
Apr 29 14:29:17.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to the Tor network. (Network is unreachable; NOROUTE; count 3; recommendation warn)
Apr 29 14:29:17.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to the Tor network. (Network is unreachable; NOROUTE; count 4; recommendation warn)
Apr 29 14:29:17.000 [warn] Problem bootstrapping. Stuck at 80%: Connecting to the Tor network. (Network is unreachable; NOROUTE; count 5; recommendation warn)
Apr 29 14:29:19.000 [notice] Bootstrapped 85%: Finishing handshake with first hop.
Apr 29 14:29:20.000 [notice] Bootstrapped 90%: Establishing a Tor circuit.
Apr 29 14:29:21.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Apr 29 14:29:21.000 [notice] Bootstrapped 100%: Done.
Apr 29 14:32:43.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later).
Apr 29 14:33:05.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later).
Apr 29 14:34:04.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later).
Apr 29 14:41:45.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later).
Apr 29 14:50:04.000 [notice] Closing stream for '[scrubbed].onion': hidden service is unavailable (try again later).

I have another service running on that computer which I can check in a few hours (timezones...). I would just ssh in and would cat hostname to get the address but... not an option now.

One question I have is... I used the authentication initially. When I removed it the hostname and key files were overwritten with new values. Is this a possibility? I thought they would remain the same.

4
  • 1
    Have you tried ssh -vvv … to see more debug information? Does it show something interesting? Commented Apr 29, 2016 at 9:38
  • replace localhost with 127.0.0.1 and check your Tor log - are there any errors? Can you browse through tor ok?
    – Alexey Vesnin
    Commented Apr 29, 2016 at 14:14
  • Updated the post. Commented Apr 29, 2016 at 20:16
  • OK it seems to be an answer starting. Do you have a way to SSH into your home HS? via VPN, for example. The logs from HS side would be just nice. The host HS name is constant for sure. Can you post your torrc's from both sides? I'll be able to help you further, then - I've solved a similar problem myself
    – Alexey Vesnin
    Commented Apr 29, 2016 at 20:36

1 Answer 1

1

I'm saddened by the solution. It was on the hidden service side. I made a vanity name/key and copied it into my blog hidden service folder, overwriting the originals. I'm guessing I never ssh'ed in after.

Took 100 minutes over the phone, texting screen pics, etc. Basically attempted to reset permissions to -rw------- from -rw-rw-r--. I'm not sure what happened on the other side. This didn't do anything.

I asked that the files in the directory be deleted. I restarted tor and let tor create it's own address & key. This worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .