1

Both SSH server and Tails client are running on the same wired network. There is no problem SSH from other machines on the same network to the SSH server.

Got the following ERROR:

connection failed, SOCKS error 1
ssh_exchange_identification: Connection closed by remote host

Tried most of the online solutions, but still doesn't work.

  • By "the same wired network" do you means LAN? If so, is the address you're trying to ssh to it as a private IP address (e.g. in one of these ranges: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16). If it's not, it will try to connect to it over Tor. – cacahuatl Jul 14 '17 at 16:12
  • 1
    They all have public IPs but only accept SSH connections from IPs within a particular range. I think when SSH goes through TOR, the SSH server considers the connection from the exit node, whose IP is not in that range. I will use private IPs for the SSH between these machines. – Amy Yu Jul 15 '17 at 4:42
1

The issue is that Tails' ssh config will try to use Tor to connect to any internet routable address, with exceptions set for private IP ranges.

Since you're referencing the public address, ssh is trying to use Tor to connect but since the destination only accepts connections from other devices on the same network, it cannot establish a Tor connection.

Tails' iptables configuration would also mean that even if ssh wasn't trying to proxy the connection over Tor, a connection to an internet address that wasn't made through Tor would be dropped.

You could setup an onion to provide ssh access over Tor (even a single-hop-onion to improve latency, since the server doesn't need location anonymity) which would allow you to ssh to it from Tails, otherwise you'd need to be able to route to it from a private IP range, specifically one of: 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.