2

I'm connecting to a server via SSH for the SOCKS proxying like this:

ssh -N -D localhost:9050 myuser@example.org

The account just needs to proxy, so it has no terminal or anything.

The client is a standard Windows 10 PowerShell. Ssh worked out of the box there, nothing additional was installed to my knowledge.

I saw this other question, How do I exit an SSH connection?, but none of the answers work. This question is not a duplicate because the other question asks how to do it on Linux (see the tags) and this is about how to do it from Windows (PowerShell in particular).

I tried:

  • Typing exit + enter
  • Typing enter + ~
  • Typing enter + ~+&
  • Typing enter + ~ + ctrl+z
  • Typing the above but with a space after the tilde, because dead keys are on for my keyboard layout
  • Typing Ctrl+d
  • Typing Ctrl+c
  • Typing Ctrl+\
  • Closing Firefox, to terminate any remaining proxy connections. This worked previously when I did still have a shell, after using the 'exit' command it would hang (and I could not make it exit in any way) until Firefox was closed.

There is no shell now, so that an 'exit' command does not work is not weird, but somehow you have to be able to exit this shell right?

Luc
  • 3,411

1 Answers1

0

To exit the Bash session, type "exit" without quotes and then the Enter key.

That should exit the SSH session and get you back to the PS C:\Windows\system32 prompt.

Just close the Powershell session by clicking on the X at the upper right corner of the window.

You said you tried this suggestion, but it just worked for me in Win10 Home with the latest updates (21H2) - I just edited a Hosts file on a network-attached Raspberry Pi4b. In your case, it sounds like you have no Bash session running, so this tip may not answer your question.

Qstik
  • 1
  • 1