TransWikia.com

Unable to port forward via ssh on windows

Server Fault Asked by JustTryingNotToFail on December 13, 2021

I am trying to port forward from a windows machine to a linux box.
In doing so, I want to create an ssh tunnel that runs in the background. According to the ssh documentation this is done with the -f parameter in order to put the tunnel in the background as well as the -N parameter to indicate to not execute any command.

ssh -L <port>:<host>:<port> user@remote_ip -i ~/path/to/id/file executes perfectly fine.
Running: ssh -L <port>:<host>:<port> user@remote_ip -i ~/path/to/id/file -f -N -vvv(Note the -f, -N)
Results in some documentation finally landing on: debug1: forking to background
Where it just hangs without ever going to the background or giving me access to the remote server.
Any help would be greatly appreciated.

For reference I am trying to connect a python script to a remote postgres database and this is my first time working within the Windows environment – I have the same script on a Mac which runs fine. The machine I am working on is on Windows 10 with the OpenSSH client installed.

One Answer

Ok, so had same issue, some digging later:

https://github.com/PowerShell/Win32-OpenSSH/issues/999

Problem seems to be unable to fork existing console, if you need in a script, then start another console using either "start ssh" or start-process from powershell

Answered by Mark Henriksen on December 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP