X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: =?ISO-8859-1?Q?Ren=E9_Berber?= <r.berber@computer.org>
Subject:  Re: cygrunsrv do not automatic start service
Date:  Wed, 16 Jul 2008 17:50:59 -0500
Lines: 49
Message-ID: <g5lu0i$617$1@ger.gmane.org>
References:  <200807170033.07266.Matthias.Meyer@gmx.li>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  quoted-printable
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
In-Reply-To: <200807170033.07266.Matthias.Meyer@gmx.li>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Matthias Meyer wrote:

> I've installed (cygrunsrv -I) a ssh tunnel with:
> /usr/bin/autossh -M 0 -o ServerAliveInterval=3D20 -o=20
> ServerAliveCountMax=3D3 -N -C -i /etc/.ssh/id_rsa -L 389:localhost:389=20
> user@server.at
>=20
> Unfortunatly this tunnel will not startet at boot time.
> If I start the service with cygrunsrv -S it will run.
>=20
> Any hint?

Several:

- Did you add the environment string required (AUTOSSH_NTSERVICE)?
- Did you add a dependency to the network? (not required but it makes=20
sense);
- Did you install the service to run as your account? (OpenSSH refuses=20
to run if the access to the keys is too lax, or if it has no access as=20
in other users don't have access to your keys).

The command line I used for installation is (with obfuscated password of=20
course):

$ cygrunsrv --install autossh --path /usr/bin/autossh --env=20
"AUTOSSH_NTSERVICE=3Dyes" --args "-M 0 -F /etc/autossh/ssh_config.remote=20
rberber@example.com" --user rberber --passwd SECRET -y tcpip

The configuration file, ssh_config.remote has all the options for ssh:

$ cat /etc/autossh/ssh_config.legosoft=20
         Host example.com=20
              AddressFamily inet
BatchMode yes
#BindAddress 127.0.0.1
CheckHostIP no
Compression yes
LocalForward localhost:3333 sunfire:3333
Protocol 2
TCPKeepAlive yes

I found that using other options, like User, IdentityFile,=20
UserKnownHostsFile, and HostName made the whole tunnel fail, I really=20
don't know why, I didn't experiment further.
--=20
Ren=E9 Berber


--
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/

