PowerShell / PowerShell/Win32-OpenSSH
Forward named pipe through SSH tunnel
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
(This is a cross-post from Stackoverflow)
I'd like to forward a named pipe over SSH, from remote Windows machine to a local machine. The remote Windows machine is running sshd. The pipe I want to forward is for the Docker Engine API, although that shouldn't matter.
To forward an equivalent Unix domain socket from a remote Unix machine, I'd run (and this works):
ssh -NL localhost:2374:/var/run/docker.sock user@host
The equivalent for a remote Windows machine named pipe would be:
ssh -NL localhost:2373://./pipe/docker_engine Administrator@windows-host
channel 2: open failed: administratively prohibited: open failed
Running sshd in debug mode, I see this when trying to connect through the tunnel:
debug1: Entering interactive session for SSH2.
debug1: pipe - read end: handle:0000000000000244, io:000001C199D59F20, fd:4
debug1: pipe - write end: handle:0000000000000238, io:000001C199D3F5F0, fd:6
debug1: server_init_dispatch_20
debug1: server_input_global_request: rtype no-more-sessions@openssh.com want_reply 0
debug1: server_input_channel_open: ctype direct-streamlocal@openssh.com rchan 2 win 2097152 max 32768
debug1: server_request_direct_streamlocal: originator ::1 port 59191, target //./pipe/docker_engine
debug1: socket - socket() ERROR:47, io:000001C199D593F0
socket: Unknown error
connect to //./pipe/docker_engine port -2 failed: Unknown error
debug1: server_input_channel_open: failure direct-streamlocal@openssh.com
debug1: server_input_channel_open: ctype direct-streamlocal@openssh.com rchan 2 win 2097152 max 32768
debug1: server_request_direct_streamlocal: originator ::1 port 59192, target //./pipe/docker_engine
debug1: socket - socket() ERROR:47, io:000001C199D593F0
socket: Unknown error
connect to //./pipe/docker_engine port -2 failed: Unknown error
debug1: server_input_channel_open: failure direct-streamlocal@openssh.com
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the remote Windows named-pipe forwarding command shown in the issue and compare it with the working Unix-domain-socket command. Investigate the server-side direct-streamlocal channel failure reported for //./pipe/docker_engine; done means the Docker Engine named pipe can be reached through the SSH tunnel without the channel being rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100