-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for additional files for ssh-add #18
Conversation
According to the docs, ssh-add only adds certain keyfiles. > ssh-add adds private key identities to the authentication agent, ssh-agent(1). > When run without arguments, it adds the files ~/.ssh/id_rsa, ~/.ssh/id_dsa, > ~/.ssh/id_ecdsa and ~/.ssh/identity. Sometimes there is the need to add more keyfiles. This is now possible by setting the SSH_ADD_ADDITIONAL_KEYFILES environment variable to the comma separated list of additional keyfiles in ~/.ssh/ ```bat set "SSH_ADD_ADDITIONAL_KEYFILES=keyfile1_rsa,keyfile2_rsa2" start-ssh-agent ``` Signed-off-by: Jan Schulz <[email protected]>
Are we really the first ones to solve this problem? If not, how do others solve it? |
cmder had an agent script which simply added all The help at github only talks about using googling for "ssh-add more than one key" also wasn't so helpful: Best I found was things like http://stackoverflow.com/a/26483359/1380673 which use ssh-add directly Googling for
There are also a lot of bash snippets, e.g. http://stackoverflow.com/a/18915067/1380673, https://gist.github.com/rezlam/850855, https://gist.github.com/gxela/5883418. The last is actually interesting as it also loads all So that doesn't look like there is a "default" for the "more than one key" usecase. I guess most users simply use I could actually live with |
Actually the last idea works great:
|
Change the implementation to the trivial one which needs keyfiles on the start-ssh-agent call :-) |
Ok, it doesn't: the current start-ssh-agent script depends on |
51765fe
to
ea4dad1
Compare
you can now also pass in a full path: set "SSH_ADD_ADDITIONAL_KEYFILES=C:\Users\jschulz\.ssh\id_rsa2,id_rsa3" ssh-add does a check if the file exist, so our check for existence now only makes it easier for the user to specify a keyfile: * if %USERPROFILE%\.ssh\<keyfile> exist, use that path * else assume that <keyfile> is a full path Signed-off-by: Jan Schulz <[email protected]>
Personally, I would prefer that... Dunno. Do you have any strong opinion? |
I don't care. Or better: I actually have a potential use case for the @svenluijten do you want to voice an opinion here? |
Good news! We may not need any patch at all... Git for Windows 2.9.3(2) just shipped, including OpenSSH 7.3p1. This OpenSSH version most notably supports the
|
@dscho Nice! Lets close this then :-) |
According to the docs, ssh-add only adds certain keyfiles.
Sometimes there is the need to add more keyfiles.
This is now possible by setting the SSH_ADD_ADDITIONAL_KEYFILES environment
variable to the comma separated list of additional keyfiles in ~/.ssh/
Report: cmderdev/cmder#1062