Skip to main content
April 1, 2022
Question

Get SSH public key with CLI?

  • April 1, 2022
  • 3 replies
  • 327 views

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

3 replies

April 4, 2022

Hey @forty2,

We're currently working on this, stay tuned!

Best,
Horia

October 18, 2022

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?

1Password Employee
November 9, 2022

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