use keychain if available to automatically start ssh-agent#2
Merged
x70b1 merged 2 commits intox70b1:masterfrom Jan 29, 2026
Merged
use keychain if available to automatically start ssh-agent#2x70b1 merged 2 commits intox70b1:masterfrom
x70b1 merged 2 commits intox70b1:masterfrom
Conversation
Owner
|
Yes, maybe if you start the agent after the login its slower than the pam-script. In my case the agent is always running and I restart them after logout, so that the system has no keys in the logged out state. What would be the benefit of |
Contributor
Author
|
I believe hash is a builtin command of bash. The benefit is, that it checks whether bash knows the command and does not assume its location or type (binary, alias, …). In this case the difference does probably not matter, I started to use it instead of test -f for all checks of executables. I see shellcheck failed, will fix that tomorrow. |
Owner
cool! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried to start the ssh-agent as a user service, but somehow the timing was off and it did not seem to start before the script tried to add the keys. So instead I added an option to use keychain, if installed.
Maybe you find this usefull.
In any case: thank you for the script, works perfectly for me with greetd, while pam_ssh did not.
cheers!
Daniel