Import ignores comments in SSH key
Comments
-
Thanks for your feedback. Yes, it currently drops the comment. I can think of a few options and I'm curious which would best fit your use case:
- Use the comment as the item title
- Store the comment as a text field
- Keep the comment on the public key
Option 3 seems like it would make editing the comment difficult. My preference is Option 1 because it could pair nicely with including the title as the comment when the 1Password agent offers public keys.
0 -
I'd prefer option 1 in my use case.
0 -
But then it would be best effort, because not every private key contains the comment embedded, or has an outdated comment compared to what's in the public key file. Automatically grabbing the corresponding
.pub
file is also not really an option, due to macOS sandboxing.0 -
Using the comment as the item title is not really ideal for everyone. The most common convention for comments I've seen is to use an email address or username because it is useful to identify who a given public key belongs to, particularly when they're listed in authorized_keys files. That's less useful to include as a title.
I've chosen to go with the conventional key file names as the item title in 1Password. So I have titles like "id_ed25519", "id_rsa", etc. That also matches the names used when downloading the private or public key files. Though, on a related note, it would be nice if I could specify the name of the exported key file, such as "id_ed25519_personal", "id_ed25519_work" or whatever other conventions other people like to use.
It would be useful to be able to include a comment when copying or downloading the public key, so having it as a text field would be good.
0 -
Unsure if there's a way to +1 this, but I came here to ask this exact question.
I think perhaps a text field would be the best solution for this, as the key is not strictly 'part' of the key itself.A great addition would be ensuring this is appended to the output of
ssh-add -L
0 -
@floris_1P - even if you can't read from the public key, you have to be able to support setting one and having it append to the stored public key for download purposes.
It also presents an opportunity for you to present that comment difference between private / public and offer to update public.
Ultimately, I don't mind if I lose comments from a public key upon import to 1Password, but I absolutely need a non-manual 'copy paste from notes field' way to enter a comment into the 1Password object and have it append on download / clipboard copy of public, along with being able to modify it.
2