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 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 AT opencoder DOT net X-Sender-Id: dreamhost|x-authsender|dropbox AT opencoder DOT net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dropbox AT opencoder DOT net X-MailChannels-Auth-Id: dreamhost X-Hook-Zesty: 24b572a86e2f3439_1626753246312_1209753228 X-MC-Loop-Signature: 1626753246312:2719399022 X-MC-Ingress-Time: 1626753246311 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= 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 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 AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cygwin Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" 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.. -- 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