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?
Get-PSSession | Remove-PSSession" from Getting Started using SSH with PowerShell – DavidPostill Mar 27 '21 at 17:50Ctrl+Break| Apparently I don't have enough reputation to be allowed to answer the question, so I'm adding my answer as a comment. Hopefully it helps for your situation. I had a similar problem (wanted to cancel an ssh command if the server was not reachable, instead of waiting for a timeout or closing the window). I found this question where the top answer recommendedCtrl+Break, and when I tried it myself, it worked! Again, hopefully this helps for you. – thejonwithnoh Jul 27 '22 at 11:11