X-Recipient: archive-cygwin AT delorie DOT 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:content-type :content-transfer-encoding:date:from:to:subject:in-reply-to :references:message-id; q=dns; s=default; b=sGZKHaDpr0XdhgBsElp5 4HUuHYca1LvGmv0L5kjiI2JxlTQtmzwPqjOfk5ZDWoVsuL3ecfPIuzp/oc5O+Clp bH4xXhE06Xj0MUGMH8E7Peob9aoJgVTRvGRDhpiuK3+1ReQ0G2VMp84N2xAi3bWj 3y+zBxDeJAR7LmK6HN2cdoA= 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:content-type :content-transfer-encoding:date:from:to:subject:in-reply-to :references:message-id; s=default; bh=miZmNdwv553gjFSSQa6EZusWpe s=; b=BQFTnj9VhZ5MnvtSi+nHQAaqL00bpOU+bCG8JVXPtUOMD4gLDYY1k6ZzGF o4ssgpA5o3T22HlhByfDz9/2SDZqDMPJiluboMdZdPbDeKUOCUe8iWY9mxbikvm8 T1Mp5mYcyZYiWjHf1UFPRIBwol5lFZuNfV2xjRd8TK1Gii738= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 20 May 2019 22:19:59 -0400 From: Chris Wagner To: cygwin AT cygwin DOT 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 AT plebeian DOT com User-Agent: Roundcube Webmail/1.3.7 X-IsSubscribed: yes 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