public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Jesse Thompson <jesset@gmail.com>, cygwin@cygwin.com
Subject: Re: using ssh-agent in cygwin
Date: Tue, 20 Jul 2021 10:24:35 +0300	[thread overview]
Message-ID: <1969591999.20210720102435@yandex.ru> (raw)
In-Reply-To: <CA+wh7KiXZFfsnk3gwbceWw3zCW3tg8g42Z8NSanas-KH2emtRQ@mail.gmail.com>

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...


      parent reply	other threads:[~2021-07-20  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 19:42 Jesse Thompson
2021-07-20  3:53 ` Wayne Davison
2021-07-20  7:24 ` Andrey Repin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1969591999.20210720102435@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=jesset@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).