From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bumble.birch.relay.mailchannels.net (bumble.birch.relay.mailchannels.net [23.83.209.25]) by sourceware.org (Postfix) with ESMTPS id 1104D385840E for ; Tue, 20 Jul 2021 03:54:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1104D385840E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=opencoder.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=opencoder.net X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 81A47362934 for ; Tue, 20 Jul 2021 03:54:06 +0000 (UTC) Received: from pdx1-sub0-mail-a13.g.dreamhost.com (100-96-16-89.trex.outbound.svc.cluster.local [100.96.16.89]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 18F32362971 for ; Tue, 20 Jul 2021 03:54:06 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net Received: from pdx1-sub0-mail-a13.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.16.89 (trex/6.3.3); Tue, 20 Jul 2021 03:54:06 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dropbox@opencoder.net X-MailChannels-Auth-Id: dreamhost X-Hook-Zesty: 24b572a86e2f3439_1626753246312_1209753228 X-MC-Loop-Signature: 1626753246312:2719399022 X-MC-Ingress-Time: 1626753246311 Received: from pdx1-sub0-mail-a13.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a13.g.dreamhost.com (Postfix) with ESMTP id B6475806BE for ; Mon, 19 Jul 2021 20:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=opencoder.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:cc:content-type; s=opencoder.net; bh=G36n32zhX6eGakzXuxqdFah JIDs=; b=lPQdAUt7I60HgDdvttt7B3IGxdPKrDbWtjujA+/ybbabtnrvTA+6frD 2QSZbPuh3DyIl/vhi7CKD3326q7z7+lODlPj+8YLqdI1K8Ocke3+KCh7UeZo4fnk ip93N6JM+RVj1Hcuuel18/A1FqRPva//nw0yFp9T46qHXW4Dhwp8= Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dropbox@opencoder.net) by pdx1-sub0-mail-a13.g.dreamhost.com (Postfix) with ESMTPSA id 64CDF806B9 for ; Mon, 19 Jul 2021 20:54:05 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id w14so26747336edc.8 for ; Mon, 19 Jul 2021 20:54:04 -0700 (PDT) X-Gm-Message-State: AOAM530mmOxKLUmaDCDYV2gGkkzf6fYA3mI84L+KO0hr9JgNtjNntl0R coAJCiDrAwvP4Xo+XiE8aPi7wLvoQl8S0ShXHYM= X-Google-Smtp-Source: ABdhPJwJIHLjutXjirv/Pg/bXyyX916mNhqKaEbHQZ2p9MeD1BxGsO5h53mhQMEF6KFYqyxpWfPt6DX4BSlpgNfO9lo= X-Received: by 2002:a05:6402:193:: with SMTP id r19mr38974597edv.104.1626753243396; Mon, 19 Jul 2021 20:54:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: X-DH-BACKEND: pdx1-sub0-mail-a13 From: Wayne Davison Date: Mon, 19 Jul 2021 20:53:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: using ssh-agent in cygwin To: Jesse Thompson Cc: cygwin Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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 03:54:10 -0000 On Mon, Jul 19, 2021 at 12:44 PM Jesse Thompson wrote: > *TL:DR;* I'm looking for options to reliably start and manage an ssh-agent > daemon in Cygwin. I recommend the "keychain" package, which is available in Cygwin. You'd add something like the following to your shell initialization scripts: /usr/bin/keychain -q $HOME/.ssh/*_?sa source $HOME/.keychain/$HOSTNAME-sh This ensures that you get prompted for your key password on first login, which unlocks all the key-file args when keychain adds them to the ssh-agent that it starts for you. Any subsequent shells just share the existing ssh-agent. If you don't like that the password prompt happens at login time, you could leave off the list of default key files and add them using ssh-add later on. I sometimes go this route and use a ~/bin/ssh shell script that looks like this: #!/bin/bash case `ssh-add -l` in *2048*|*1024*) ;; *) ssh-add ~/.ssh/*_?sa ;; esac exec /usr/bin/ssh "${@}" This method asks you for your key password the first time you run ssh. ..wayne..