Get SSH public key with CLI?

forty2forty2
Community Member

Hi all,

I've been playing with the new SSH key support (which is amazing!) but I've run into a few situations where it would be useful to be able to fetch the public key with the CLI. Unfortunately, that doesn't seem to be possible; op item get seems to only return the private key. I suppose I could store it as a note, but I really don't want to have to duplicate it like that. Is there another way? If not, I'd love to see it added -- is there a feature request process?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • Horia.Culea_1PHoria.Culea_1P

    Team Member

    Hey @forty2,

    We're currently working on this, stay tuned!

    Best,
    Horia

  • marksie19881marksie19881
    Community Member
    edited October 18

    Is there any update on this?

    If i do op item get ssh_key it shows the fulll item but if i do op item get ssh_key --fields publicKey it is blank, I really need this for some automation im working on.

    I also notice that i cant seem to return the privatekey in OpenSSH format, it is some other format?

  • andi.t_1Pandi.t_1P

    Team Member

    Hi @marksie19881 , op item get SSHKey --fields 'public key' should do the trick. Changing the user-facing format of the private key to OpenSSH is on our WIP list but is a broader scope change. The fact that the same value needs to be displayed in OP8 desktop app requires coordination and no promises for when this will be done can be made.

    All the best,
    Andi

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file