X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=JDkesKX
	YvJS9A9Rjn4DFLrC2Wb9xoMPlubaxRBsnJ9K+w2GAQLf3+hM560qnwsUgiTq299R
	byF1Qkyuaa+v0WQbcK9k64rJRUFx+EzF5Z4pc+tOY2e12Y76bwoRI1q0M256gn+O
	XqI6lRq5Ki5mPR+eYZvGmNGt0Rf/HM/88JYU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:content-type; s=default; bh=6J0b1z9mDDB1Z
	lcOnGFEYfqpjOI=; b=X7ixQVFPwLzsVOEpGl57oUQOVCCZXmGVrt2EKEOlOz9Qg
	K9RpIFnCs6O7zNkBrf/Fku9xj3YJD00ndnd6SvfsKnhTbWnoRFJdzk/yfIdbds0R
	Rq/HwWJKDRChRjo58nyMzXjUANuCLStPzXmHiayanDj2XJecNc+mv7zL65//9c=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=wagner, sk:unsubsc, chris, Easy
X-HELO: mail-wr1-f68.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=mime-version:references:in-reply-to:from:date:message-id:subject:to;        bh=f4Ldrl6F7n5B76nudY/yHZU0baXsLUYPTxS25mlNT2E=;        b=eWnXpR89jZc6ivzBXpgxDzBTYYjIfd9L3fLT4BSBjSXMJ6XKVAWKVpCcP8Z+EP9HTI         yI9Ohpv+fI+b4OneQ4wP5h0Gdna4taS899+xuCS9Hqzr5NmhSR9ifvJuifzPz0vE+Maq         DedrJpCqVJG2LuQFgvkyV3CgI1RBoekq27qupX0WbA0AQu7aP20lv2jHjR9188BxO4o1         yxJjw3KVXCWi7DeYR7FOzunZW+9XK4/4gkTAzsnxPPaWrbV3AQoTXEGr+lfOqJ/jJutq         Z0XaRLONHfA5CJV/Wz470M3axo9dNEvgEuV7tEqJXqSzH63oJRYCxIZc9OD0knCep2IT         FsSg==
MIME-Version: 1.0
References: <CAJoYywWVTtoq1dN9hy5oxvdYzFN0qk70s-UNX198rZYiULreVA@mail.gmail.com> <55eb0fac0febf91e25b30f906b552403@plebeian.com>
In-Reply-To: <55eb0fac0febf91e25b30f906b552403@plebeian.com>
From: Irfan Adilovic <irfanadilovic@gmail.com>
Date: Wed, 22 May 2019 18:30:46 +0200
Message-ID: <CAJoYywXrBkpo4BLK416uyvrf1qShbPmZA6nUzLRL-0aMVDTG7w@mail.gmail.com>
Subject: Re: cygrunsrv --install <svc> --user <user>: avoid having to enter the user's password
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes

On Tue, 21 May 2019 at 04:20, Chris Wagner <wagnerc@plebeian.com> wrote:
>
> Hi Irfan,
>
> I'm assuming that there is some reason you don't want to use the
> password option:
> -w, --passwd <password>   Optional password for user. Only needed
>                              if a user is given. If a user has an empty
>                              password, enter `-w '. If a user is given
> but
>                              no password, cygrunsrv will ask for a
> password
>                              interactively.

Nope, no reason, I completely missed this option... While I was hoping
to not have to enter any password (like for SYSTEM, but I guess that
account's special) -- this is also fine, thanks a lot.

-- Irfan

> The password prompt can be scripted with Perl.  (Assuming you *have* the
> password)
>
> use IO::Pty::Easy;
> $io = IO::Pty::Easy->new;
> @cmd = qw{cygrunsrv -I name -t manual -p /c/foo.exe -u name};
> $io->spawn(@cmd);
> printf "read: %s\n", $io->read;
> printf "write: %s\n", $io->write("foo\n");
> printf "read: %s\n", $io->read;
> printf "write: %s\n", $io->write("foo\n");
> printf "read: %s\n", $io->read;
> $io->close;
>
>
> Hope that helps.
> -Chris
>
>
> On 2019-05-19 11:49 pm, Irfan Adilovic wrote:
> > Hi,
> >
> > (All actions here assume an elevated mintty terminal)
> >
> > I have the  need to automate the installation of autossh as a windows
> > service (=> several dozen autossh services) and when installing as a
> > local user, the password prompt is an issue.
> >
> > Is there a way to add windows services with cygrunsrv from an elevated
> > mintty bash shell to run as a local user, somehow without requiring
> > that local user's password each time the service is installed?
>
>
> --
> 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
>

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

