X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF49C385E02C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1626766500; bh=pcycJRT63PPvd2vNkeZTPnfne6W/6twHU3nt1BJTL6g=; h=In-Reply-To:Subject:To:Message-ID:From:References:Date:Reply-To; b=nhPiqQf5X3JmefTO/76+mocxDmYydZNrwG5/ckl1uEQSgDUJZ8a9+UGWtu9p/ESrl 3ZNtv2aXqqvXpPfzPOzuBzs70xWwPeRfclD4bgKlKIUstvQimL1htc5JG/cGfoHOsE cjVruLnl5Apusxduu2crF1XfD+riy2o6YUTq40vw= Authentication-Results: sas1-428702d1293e.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Date: Tue, 20 Jul 2021 10:24:35 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home X-Priority: 3 (Normal) Message-ID: <1969591999.20210720102435@yandex.ru> To: Jesse Thompson , cygwin AT cygwin DOT com Subject: Re: using ssh-agent in cygwin In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Greetings, Jesse Thompson! > *TL:DR;* I'm looking for options to reliably start and manage an ssh-agent > daemon in Cygwin. I'm using ssh-pageant myself. But I do have a compatible wrapper for ssh-agent. > Using ssh-agent in cygwin seems very compelling. Oh? > OpenSSH client config AddKeysToAgent option and ssh-agent -t option allow me > to keep keys unlocked for limited times the way that I'd like, and unlock > upon use instead of upon login, and avoid having to manually ssh-add. Fine, I guess? > But I'm left with the issue of "how can all of my shell windows use the > same daemon" and "how can I get the daemon to start automatically without > spawning an army of unmanaged zombies"? > $HOME/.local/bash/.bashrc.d/ssh-agent >> # Import ssh-pageant settings >> test -f "$HOME/.ssh/agent" && . "$HOME/.ssh/agent" Conveniently, add to .bashrc: for f in "$HOME/.local/bash/.bashrc.d/"*; do test -f "$f" && . "$f" done > I have to assume that ssh-agent is very popular to use, and that > copy-pasting 6-12 lines of fragile, custom bash code into one's profile > doesn't have to be the primary way to get into this club. Eh? > So, how do you guys manage ssh-agent? Is it really a niche solution, and > there's some better way to get similar SSO-like benefits I should know > about instead? You should stop bashing into open door. > Please advise, thanks folks! If you want a robust solution, a small wrapper script is required. Something like https://pastebin.com/gQ4xfcvJ -- With best regards, Andrey Repin Tuesday, July 20, 2021 0:09:24 Sorry for my terrible english... -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple