From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: Backgrounding part of 'ssh-agent $cmd'
Date: Fri, 18 Jan 2013 16:13:22 +0200 [thread overview]
Message-ID: <20130118141322.GE4666@lp-shahaf.local> (raw)
In-Reply-To: <130117232602.ZM23841@torch.brasslantern.com>
Bart Schaefer wrote on Thu, Jan 17, 2013 at 23:26:02 -0800:
> I'm glad my suggestion answered your question, but I don't think that I
> have solved your actual problem. Wandering a bit afield of zsh here ...
>
The part that I find less than ideal so far is that, under load, the GUI
ssh-askpass dialog appears after foo_main has started. It's a problem,
not because of the ordering (it's not a problem even to run
foo_ssh_preseed only after foo_main has started), but because my "enter
ssh pw, enter foo_main pw" muscle memory gets bypassed.
> On Jan 18, 8:18am, Daniel Shahaf wrote:
> }
> } Yes, and yes my distribution sets up a session-global ssh-agent
> } instance. Using a separate agent was a means to an end: not having the
> } ssh keys decrypted in memory whilst the laptop is hibernating.
>
> I'm not sure you've actually accomplished that. From what you've
> described, you're counting on the set of ssh created in foo_ssh_preseed
> to exit because the network connections time out while the laptop sleeps?
>
Indeed.
> That means "ssh-add -D" doesn't run until the laptop *wakes up again*
> and the "wait" in foo_ssh_preseed returns. The agent's memory state
> is dumped in the hibernate data with the keys still loaded. Boot from
> removable media and that data could be mined. Am I missing something?
>
'ssh -MNf' daemonizes itself, so foo_ssh_preseed takes about 5 seconds
from start to finish.
<OT>The daemons open and keep open SSH TCP connections, so that subsequent
interactive 'ssh host1' commands don't need to do the TCP handshake and
SSH authentication handshake --- which speeds them up. This relies on
ControlPath (and maybe ServerAliveInterval) being set in ~/.ssh/config.</OT>
I'd tell you exactly how long foo_ssh_preseed takes, but time(1zsh)
doesn't work on functions:
% zsh -fc 'time () { sleep 1 } '
% zsh -fc 'f(){ sleep 1 } ; time f'
> You would need Christian's suspend-hook idea to get "ssh-add -D" to
> run before the laptop hibernates. In which case you might as well
> use the session-global agent ...
Thanks,
Daniel
next prev parent reply other threads:[~2013-01-18 14:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 6:59 Daniel Shahaf
2013-01-16 17:35 ` Bart Schaefer
2013-01-18 6:18 ` Daniel Shahaf
2013-01-18 7:26 ` Bart Schaefer
2013-01-18 14:13 ` Daniel Shahaf [this message]
2013-01-18 15:35 ` Bart Schaefer
2013-01-21 3:58 ` Daniel Shahaf
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=20130118141322.GE4666@lp-shahaf.local \
--to=d.s@daniel.shahaf.name \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).