ccontavalli / ssh-ident

Different agents and different keys for different projects, with ssh.
Other
963 stars 71 forks source link

I'm a dummy who can't read - Could you make it clearer that ssh-ident needs both private and public keys? #60

Open Makeshift opened 4 years ago

Makeshift commented 4 years ago

I fully admit that I'm just stupid and glazed over the part of the docs that said that.

After much debugging (see: adding print statements because I was too lazy to open an IDE), I realised that ssh-ident was identifying that my priv key existed (yay!) but skipping over it in FindUnloadedKeys because it didn't have an accompanying .pub (boo!). I then searched the readme for "public key" and immediately found the line telling me I needed both. Oops.

I was just curious why it requires a public key. From what I can tell it's simply used as a quick check to see which keys are loaded in ssh-add -l, in which case, couldn't ssh-keygen -l -f be used upon load of a priv key if a corresponding pub couldn't be found? I'm not sure if I'm an uncommon case, not storing my priv/pub keys in id_rsa and id_rsa.pub in the same folder, but until I found ssh-ident I had quite a lot of keys in the same folder with different names.

It also may be worth updating this line in the docs:

Note that ssh-ident needs to access both your private and public keys. Note
also that it identifies public keys by the .pub extension. All files in your
identities subdirectories will be considered keys.

as it isn't entirely accurate, being that PATTERN_KEYS has a fairly strict regex on what should be considered keys.

Anyway, aside from me being dumb, excellent tool! Now I've got it set up, it works like a charm.

maddes-b commented 2 years ago

Can you have a look at the fork at https://github.com/ssh-ident/ssh-ident1 if the updated passage fits your expectations.