maxgoedjen / secretive

Store SSH keys in the Secure Enclave
MIT License
7.24k stars 159 forks source link

Key selection optimization/steering #236

Open zacwest opened 3 years ago

zacwest commented 3 years ago

I've got a handful of keys in Secretive, but enumerating through the possible public keys when connecting to git.sr.ht causes it to kick me out for exceeding authentication attempts before it reaches the key that I've added there.

I can see a few possible enhancements here, other than adding the pubkey as an IdentityFile in the ssh config:

  1. Changing the order that keys are vended to ssh in
  2. Somehow allowing binding a certain key to certain hosts or connection attempts
ambis commented 3 years ago

This is 100% my opinion: SSH already provides a way to solve the mentioned problem (namely IdentitiesOnly=yes and IdentityFile=key-created-in-Secretive-and-this-file-contains-its-public-key.pub.

I hope development work and efforts are directed towards features that have no other solution.

Peace.

tylervick commented 1 year ago

Adding my data point here: It was definitely unexpected to have my auth fail on what appeared to be an arbitrary identity limit..

Since MaxAuthTries defaults to 6, a host without an explicit identity defined will never succeed if the expected key is not in the first $MaxAuthTries keys returned by Secretive.

Not sure what the best solution is here, as I agree with @ambis that IdentityFile is fine solution. Perhaps documenting this alongside ssh config setup? The ability to reorder keys (if possible) may also be good, e.g. I always want my throwaway "wildcard" identity attempted first..

ardera commented 10 months ago

This is 100% my opinion: SSH already provides a way to solve the mentioned problem (namely IdentitiesOnly=yes and IdentityFile=key-created-in-Secretive-and-this-file-contains-its-public-key.pub.

I hope development work and efforts are directed towards features that have no other solution.

Peace.

In my case, I want to have 2 keys:

In that case I need both the unlocked and locked key to be attempted. But because I set up my locked key first, it'll try that first and I always need to touch id. And because I can't reorder, I now need to create a new locked key so it's after my unlocked key and redeploy that to every device and service I use (which is roughly 30mins work in my case). If I could reorder keys, it'd just be a single drag & drop.

It's not too hard to work around but still, super inconvenient in my case. Other than that, I'm really thankful for this app and all the hard work you put into it!