Currently you can't set a lifetime for a key added by AddKeysToAgent other than the lifetime set when running ssh-agent with -t. Add an ssh_config AddKeysToAgentLifetime option to allow the setting of a lifetime if a key is added via AddKeysToAgent.
Created attachment 3165 [details] Adds "AddKeysToAgentTimeout" option for ssh_config I've attached a patch which provides a "AddKeysToAgentTimeout" option for ssh_config. It's been running on my personal machine for a few weeks without issue but I'd appreciate anyone with more experience looking it over.
Created attachment 3188 [details] Slightly revised patch which tweaks documentation I've slightly reworded the documentation in the patch from djl@mksh.org, just to specify that the timeout relates to the AddKeysToAgent option. Most of the work is still theirs, including all actual source code changes which I did not touch.
Created attachment 3439 [details] AddKeysToAgent with interval support This adds support for specifying an interval to AddKeysToAgent, including requesting both per-use confirmation and an interval via AddKeysToAgent="confirm 5m"
*** Bug 2191 has been marked as a duplicate of this bug. ***
This has been committed and will be in OpenSSH 8.4.
closing resolved bugs as of 8.6p1 release