www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/09/05:58:48

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andrew Schulman <schulman DOT andrew AT epamail DOT epa DOT gov>
Subject: Re: cygrunsrv autossh - tunnel does not come up
Date: Fri, 09 Jan 2009 05:58:12 -0500
Lines: 46
Message-ID: <5uaem4hkujkube83ulle0s8fsm93mghahi@4ax.com>
References: <21362436 DOT post AT talk DOT nabble DOT com> <gk65nu$nqh$1 AT ger DOT gmane DOT org>
Mime-Version: 1.0
X-Archive: encrypt
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

> > I have problems running autossh via cygrunsrv on WIN2003:
> >  
> > /bin/cygrunsrv.exe -I AutoSSH -p /bin/autossh -a "-M 20000 -g2CN -R
> > 20120:localhost:3389 -i /etc/key-rsa -p 20012 user AT 192 DOT 168 DOT 100 DOT 12" -e
> > AUTOSSH_NTSERVICE=yes -y tcpip --type auto
> > 
> > As soon as I start the service (net start autossh) it stops. So it looks
> > like it never came up:
> > Autossh.log:
> > 2009/01/08 23:26:25 autossh[10148]: starting ssh (count 1)
> > 2009/01/08 23:26:25 autossh[10148]: ssh child pid is 9528
> > Host key verification failed.
> > 2009/01/08 23:26:25 autossh[10148]: ssh exited prematurely with status 255;
> > autossh exiting
> > 
> > Running just ssh or autossh the tunnel comes up and stays:
> > ssh: ssh -v -g2CN -R 20120:localhost:3389 -i /etc/key-rsa -p 20012
> > user AT 192 DOT 168 DOT 100 DOT 12
> > autossh: /bin/autossh -M 20000 -g2CN -R 20120:localhost:3389 -i /etc/key-rsa
> > -p 20012 user AT 192 DOT 168 DOT 100 DOT 12
> 
> There's a big difference between running it as a service like you did,
> and running it as a user.

Agreed.  "Host key verification failed" tells me that either the permission or
the ownership of /etc/key-rsa is wrong-- if you're going to run autossh as a
SYSTEM service, then the key has to be owned by SYSTEM and only readable by it.
Another possibility is that the key is encrypted, so SYSTEM can't read it
without a password; maybe your user process is getting it from an ssh-agent.

A good way to get more information about why the service fails to start would be
to add -v or -vv to the ssh flags (within the argument of -a).

> First thing to try: run the service as your user, i.e. add --user <user
> name> to the service installation.

Yes, this is really better.  I need to recommend this in the autossh README.

> And don't expect too much, I use it all the time and it works but it
> fails to start very often, I end up starting it manually.

Hm, I'm surprised to hear that.  I haven't run autossh as a service in a while,
but when I did it worked very reliably for me.  Can you tell me anything more
about how or why it fails to start?

Andrew.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019