Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-15-2012, 11:29 PM   #1
LQ Newbie
Registered: Dec 2012
Posts: 2

Rep: Reputation: Disabled
"Shared connection to host closed."

Hello. This is not my first post, but I don't remember the username I used to use and apparently used an old email address. So, it's a new account for me.

I have a need to remotely administrate a Windows 7 machine. (I know. It's, not but bear with me... please?) Having much more experience with Linux than Windows and knowing the amount of power Linux utilities would give me for administrating the box, I installed Cygwin and OpenSSH.

Given the bandwidth and latency considerations, I'll be using a ControlMaster ssh connection and running various ssh-related commands (such as bash, port forwarding, scp, etc) through that.

I've got it all set up, and it all works except for one thing.

I set up the master connection with:
ssh -fCNMS /tmp/ssh.sock user@host
I can run a remote shell with:
ssh -S /tmp/ssh.sock user@host
However, if I end the remote shell (with ctrl-d or "exit") and try to run it through the same master connection again, I get the following:
> ssh -vvv -s /tmp/ssh.sock user@host
openssh_5.9p1-hpn13v11, openssl 1.0.0j 10 may 2012
debug1: reading configuration data /home/localuser/.ssh/config
debug1: reading configuration data /etc/ssh/ssh_config
debug2: fd 3 setting o_nonblock
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_request_forwards: requesting forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 6976
debug3: mux_client_request_session: session request sent
warning: untrusted x11 forwarding setup failed: xauth key data not generated
warning: no xauth data; using fake authentication data for x11 forwarding.
debug1: mux_client_request_session: master session id: 2
x11 forwarding request failed
last login: sat dec 15 23:07:49 2012 from
debug3: mux_client_read_packet: read header failed: broken pipe
debug2: received exit status from master 255
shared connection to host closed.
Also, I can copy files to the remote machine with:
scp -o ControlMaster=no -o ControlPath=/tmp/ssh.sock file.txt user@host:/tmp
However, doing that a second time fails with the message "lost connection".

Closing the master connection and restarting the connection lets me open a shell or scp a file again.

I'm not sure whether it's a client or server issue, but even though the server is on Cygwin, I imagine you folks will have an idea what's up.

Thanks in advance for your help!
Old 12-18-2012, 06:13 PM   #2
LQ Newbie
Registered: Dec 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hmm. Well, I guess the OpenSSH mailing list might be the place to take this question, then. Thanks for reading, anyway.
Old 04-11-2018, 12:57 PM   #3
LQ Newbie
Registered: Aug 2008
Distribution: CentOS, Debian, Arch
Posts: 3

Rep: Reputation: 0
Just for the record:
I've the same issue but resolved by changing package name.

Better explanation:
- environment: Ansible server = Centos 7, Ansible client = ArchLinux
- Issue: an ArchLinux package changed its name
- Resolution: Changed the package name to its new name in the specific Ansible Playbook


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Telnet "Connection closed by foreign host" jhilton Linux - Networking 37 03-29-2016 04:33 AM
SSH issue ""Server unexpectedly closed network connection" Errsta_Fonzarelli Linux - Software 12 05-24-2010 02:35 PM
Telnet error "Connection closed by foreign host" without prompting login. jhilton Linux - Newbie 1 06-25-2008 06:36 PM
FTP problem "connection closed by remote host" with RHEL4 and Windows 2003 hooijack Linux - Enterprise 0 03-23-2006 09:29 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration