X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Andrew Schulman Subject: Re: 1.5.25 under XP Pro SP3: autossh service drops connection immediately after pubkey authentication Date: Fri, 27 Nov 2009 06:59:14 -0500 Lines: 53 Message-ID: References: <1b1998920911221143m38777d7drb6180e1832fa6808 AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive: encrypt X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi Ashton. I haven't been able to fully look into your problem, but it is unusual and reads like a bunch of permission problems. Here are my best guesses: > I've had to set /etc/ssh_config StrictHostKeyChecking to No otherwise > host key verification will fail. I think you need to create /etc/ssh/ssh_known_hosts and make it writeable by SYSTEM. Or /etc/ssh_known_hosts? Since it appears that you have all of your ssh configs in /etc instead of /etc/ssh. That is unusual, although I don't think it should cause any problems for autossh. > The autossh command line -i switch must look like > "/cygdrive/c/cygwin/home/Administrator/.ssh/id_rsa" rather than > "~/.ssh/id_rsa" otherwise it will not find the id_rsa key and the > connection will fail. Since your service is running as user SYSTEM, ~ refers to SYSTEM's home, not Administrator's. > The previous two problems I've managed to workaround although I dont > understand why they come up in the first place.  In the end however, > the service manages to start, connects to my Openssh server and > authenticates, but then immediately drops the connection and the > autossh service stops.  I am running it as a SYSTEM service and I > believe I've set all the ownership and permissions correctly.  Regular > ssh into my server works correctly.  Autossh manually into my server > works correctly.  How do I fix this last problem? I've looked at the log you provided (thanks for the detailed report), and it's not clear what's causing the service to stop. It says debug2: exec request accepted on channel 1 debug2: channel 1: read<=0 rfd 5 len 0 debug2: channel 1: read failed and it's all downhill from there. About all I can suggest is to try different users: either change your service to run as Administrator or, preferably, an unprivileged user (in which case you'll have to change a bunch of key and directory ownerships); or if you can, run a shell as SYSTEM and see if you can connect by ordinary ssh. Please let me know what you find. I'll update the autossh README if I've overlooked any important advice there. Last gasp standard advice I guess would be to update to Cygwin 1.7, but I have no reason to believe that that would change anything, since autossh so far hasn't even been rebuilt for 1.7. Good luck, Andrew. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple