From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8983 invoked by alias); 21 May 2019 02:20:03 -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 8976 invoked by uid 89); 21 May 2019 02:20:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.1 spammy=H*u:1.3.7, H*UA:1.3.7, Easy, Adilovic X-HELO: www16.qth.com Received: from www16.qth.com (HELO www16.qth.com) (69.16.238.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 May 2019 02:20:02 +0000 Received: from [127.0.0.1] (port=41795 helo=www16.qth.com) by www16.qth.com with esmtpa (Exim 4.91) (envelope-from ) id 1hSuNj-00B7WE-NH for cygwin@cygwin.com; Mon, 20 May 2019 21:19:59 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 21 May 2019 02:20:00 -0000 From: Chris Wagner To: cygwin@cygwin.com Subject: Re: cygrunsrv --install --user : avoid having to enter the user's password In-Reply-To: References: Message-ID: <55eb0fac0febf91e25b30f906b552403@plebeian.com> X-Sender: wagnerc@plebeian.com User-Agent: Roundcube Webmail/1.3.7 X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00195.txt.bz2 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. 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