From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110091 invoked by alias); 22 May 2019 16:31:08 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 110062 invoked by uid 89); 22 May 2019 16:31:03 -0000 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 Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 May 2019 16:31:00 +0000 Received: by mail-wr1-f68.google.com with SMTP id d18so3034406wrs.5 for ; Wed, 22 May 2019 09:31:00 -0700 (PDT) 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: <55eb0fac0febf91e25b30f906b552403@plebeian.com> In-Reply-To: <55eb0fac0febf91e25b30f906b552403@plebeian.com> From: Irfan Adilovic Date: Wed, 22 May 2019 16:31:00 -0000 Message-ID: Subject: Re: cygrunsrv --install --user : avoid having to enter the user's password To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00203.txt.bz2 On Tue, 21 May 2019 at 04:20, Chris Wagner wrote: > > Hi Irfan, > > I'm assuming that there is some reason you don't want to use the > password option: > -w, --passwd 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