0

I have set up an onion service on a machine (running Ubuntu Server 22.04) that provides both web and SSH access, such that this is the torrc:

HiddenServiceDir /var/lib/tor/myservice/
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 22 127.0.0.1:22

If I go to myservice.onion in Tor browser on any operating system, the website loads successfully, and when I run the following command on Linux I can login successfully:

ssh -o ProxyCommand="/usr/bin/nc -xlocalhost:9050 -X5 %h %p" username@myservice.onion

I can also login successfully if I define settings for *.onion hosts in my ~/.ssh/config file, therefore logging in through SSH on Linux is not a problem.

However, I am unable to login on windows using the above command (since /usr/bin/ is not a valid directory), so I tried to use PuTTY (I have release 0.76 installed) to login. I read this question, which seems to have no answers, as well as the Tor project PuTTY guide, which said to configure the proxy settings such that PuTTY is using a SOCKS5 proxy, Proxy hostname is localhost, the port is 9050, DNS name lookup is set to yes, and the Telnet command field contains connect %host %port\n.

When I configure those exact settings, as you can see here and here, I simply get this error. (I have the latest version of Tor Browser for Windows running while PuTTY is running, so the localhost proxy should work).

My question is, how do I connect to my onion service via PuTTY? Alternatively, is there any other way to connect to it via SSH on Windows?

3
  • The default Tor Browser SOCKS port is 9150, not 9050. You should try that instead.
    – Steve
    May 21 at 18:08
  • @Steve Thank you, I changed the port to 9150 instead of 9050, and I was able to successfully login to the onion service. I find it strange that the Tor project documentation, as well as the Linux box running the onion service, both showed port 9050.
    – Richard
    May 21 at 21:37
  • The tor daemon's proxy (for example what you get if you run apt install tor) uses port 9050. The Tor Browser's proxy uses port 9150 instead so that it doesn't conflict with the tor daemon if you have that installed.
    – Steve
    May 22 at 20:56

1 Answer 1

0

As Steve pointed out in a comment, the solution is to keep the same settings, but set the PuTTY SOCKS5 proxy to run on port 9150, after which the SSH login works successfully.

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.