From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by sourceware.org (Postfix) with ESMTPS id CF49C385E02C for ; Tue, 20 Jul 2021 07:35:02 +0000 (GMT) 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 Received: from sas1-428702d1293e.qloud-c.yandex.net (sas1-428702d1293e.qloud-c.yandex.net [IPv6:2a02:6b8:c08:4c8b:0:640:4287:2d1]) by forward105p.mail.yandex.net (Yandex) with ESMTP id E3A494D41A4B; Tue, 20 Jul 2021 10:35:00 +0300 (MSK) Received: from sas1-f4dc5f2fc86f.qloud-c.yandex.net (sas1-f4dc5f2fc86f.qloud-c.yandex.net [2a02:6b8:c08:cb28:0:640:f4dc:5f2f]) by sas1-428702d1293e.qloud-c.yandex.net (mxback/Yandex) with ESMTP id B23BA2bXQG-Z0Hu66Hv; Tue, 20 Jul 2021 10:35:00 +0300 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 Received: by sas1-f4dc5f2fc86f.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id qtzriDJeVl-Z05SQGua; Tue, 20 Jul 2021 10:35:00 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 20 Jul 2021 07:24:36 -0000 Date: Tue, 20 Jul 2021 10:24:35 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home Reply-To: cygwin@cygwin.com X-Priority: 3 (Normal) Message-ID: <1969591999.20210720102435@yandex.ru> To: Jesse Thompson , cygwin@cygwin.com Subject: Re: using ssh-agent in cygwin In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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@cygwin.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: , X-List-Received-Date: Tue, 20 Jul 2021 07:35:07 -0000 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...