Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

Port forwarding / tunnelling with -fN doesn't go into the background

Open ghost opened this issue 7 years ago • 4 comments
trafficstars

"OpenSSH for Windows" version 0.0.24.0

Client OperatingSystem Windows 10 Pro 1703

What is failing ssh -fN -L2222:somehost:22 someotherhost should go into the background while the tunnel remains open

The tunnel works, but the command ties up the terminal - it doesn't go into the background

ghost avatar Dec 23 '17 01:12 ghost

There is no concept of running background console jobs in Windows??

bagajjal avatar Dec 28 '17 05:12 bagajjal

AFAIK no. You may use start ssh .... to achieve something close.

manojampalam avatar Jan 30 '18 06:01 manojampalam

I don't know why for Windows openssh-portable doesn't support spawning the process and detaching from the console after credentials have been accepted, but if anyone desperately needs this I have a work around.

I've implemented a way to do it in this short pwsh script that you can dot-source, it works by spawning a Process which successfully establishes a connection and backgrounds itself, but there's no nohup equivalent if you're planning on closing the terminal after.

Hashbrown777 avatar Nov 05 '22 07:11 Hashbrown777

Are there news for this? I'm just using wsl for this reason for now to connect to hpc

alex180500 avatar May 29 '24 12:05 alex180500