maxgoedjen / secretive

Store SSH keys in the Secure Enclave
MIT License
6.99k stars 155 forks source link

ux: removing the smart card removes the public key file #527

Open martinpaljak opened 5 months ago

martinpaljak commented 5 months ago

A smart card public key file is deleted from the disk on card removal, while it might be beneficial to have it there at all times, to not generate a warning (no such identity: /Users/martin/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/xxx.pub: No such file or directory) if the file is referenced in .ssh/config IdentityFile and the card is not currently inserted.

Workaround is to copy the pubkey to a permanent location, like inside ~/.ssh. If the key in the fixed file is the only one suitable for authentication but not present in the agent, the error will still be magnificent: Load key "/Users/martin/.ssh/test.pub": invalid format ... (OpenSSH_9.4p1, LibreSSL 3.3.6)