openssh-portable icon indicating copy to clipboard operation
openssh-portable copied to clipboard

ssh-agent: remove all keys upon SIGUSR1..

Open sdaoden opened this issue 3 years ago • 8 comments

With the advent of per-user temporary directories it became hard for an administrator to remove all keys from all running ssh-agent instances; what formerly could be done like so

if command -v ssh-add >/dev/null 2>&1; then for a in /tmp/ssh-/agent.; do [ -e "$a" ] || continue act "SSH_AUTH_SOCK="$a" ssh-add -D </dev/null >/dev/null 2>&1 &" inc done fi

has become a major undertaking, especially with even more containerization. Being able to remove all keys from all agents with a single command seems so desirable that it is available in other agents in the software world.

sdaoden avatar Jan 22 '22 01:01 sdaoden

Ah. Merde! Sorry, i thought "mergeable" meant the pull request!

sdaoden avatar Jan 22 '22 01:01 sdaoden

..and one more sorry, this was not meant to be closed. I might become a github expert.

sdaoden avatar Feb 01 '22 13:02 sdaoden

This looks good to me and the better signal handling could allow us to make cleanup_handler() a regular call in future (i.e. no longer calling it in signal context).

Would appreciate @daztucker taking a look at this too

djmdjm avatar Apr 29 '22 05:04 djmdjm

(It is all taken from sshd.c of course. Only to mention it. I .. do not implement this cleanup like it is done in sshd.c in this context here now!?!) Thank you for looking into this.

sdaoden avatar Apr 29 '22 21:04 sdaoden

But surely not because of this changeset, no? Never used CI as it is here; but there is no log at all for the failure, not even a build one?

sdaoden avatar Sep 29 '22 16:09 sdaoden

(i do not understand this CI-fuzz github thing which fails in one out of dozens of things. this should have nothing to do with the little patch, i would think.)

sdaoden avatar Dec 23 '23 20:12 sdaoden

Interestingly "the ppoll part has just recently been committed" almost as stated here. Please let me allow one sentence: what a crappy attitude to leave that truly desired piece of code laying around for two years. git allows selective staging via "git add -p", and you would have had it 22 months ago. Anyhow, this little pull request is now solely the SIGUSR1 handling, and all tests ran.

sdaoden avatar Mar 11 '24 19:03 sdaoden

P.S.: "you would have had it 22 months ago": within less than 30 seconds.

sdaoden avatar Mar 11 '24 19:03 sdaoden