Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is SSH ControlMaster with Cygwin on Windows actually possible?

Has anyone been able to use control master with cygwin on Windows to create multiple sessions without having to log on repeatedly? I need to automate a succession of SSH steps but cannot ask the user to enter the required tokenized password eachtime.

I have configured my cygwin ssh_config with following:

Host *     ControlMaster auto     ControlPath /tmp/%r@%h:%p 

And I get the following error message on the master when I start a second connection which prompts for the password again:

mm_receive_fd: no message header process_mux_new_session: failed to receive fd 0 from slave 

I've seen others with this problem but I can't seem to find any solution for this.

Has anyone made this work?

like image 911
Giovanni Avatar asked Jan 06 '14 21:01

Giovanni


2 Answers

Apparently the conclusion after much searching is that currently it is NOT possible. These were the only links I found that dealt with this:

https://stackoverflow.com/questions/17140457/imitating-a-shared-ssh-session-for-scripts-on-windows "...but there is no implementation of OpenSSH for Windows which does this (file descriptors over unix sockets do not work in Cygwin)." and

http://gcc.gnu.org/wiki/SSH_connection_caching "Unfortunately if you are using OpenSSH on Cygwin you will not be able to take advantage of connection caching because Cygwin does not currently support file descriptor passing via unix-domain sockets."

like image 132
Giovanni Avatar answered Sep 18 '22 15:09

Giovanni


For Cygwin it still seems not possible, but in Windows, it is possible. I have this working in windows using wsl-ssh-pageant and the Windows Ubuntu Bash/WSL).

Under bash install socat. Then run wsl-ssh-pageant as it says, then with the while loop and export. If you have your controlmaster under .ssh setup correctly and the directory for ControlPath is created, is should work.

like image 27
hunterofcow Avatar answered Sep 19 '22 15:09

hunterofcow