2

I'm a bit new to SSH and it's technique, but used it to connect to websites on my old MacBook.
Since I now have a new one, I want to use the same key if thats possible. I saved the (ssh-rsa) key in 1Password.
Now I want to overwrite the default "id_rsa" file if that's possible, so my connection is working again. Is this possible and how can I encrypt this key and replace the current key in the id_rsa file?

Thanks!

7
  • 1
    Can't you just replace the file?
    – nohillside
    Commented Feb 5, 2021 at 13:11
  • I wish, but unfortunately my old one isn't working anymore..
    – Loosie94
    Commented Feb 5, 2021 at 13:21
  • How is your ssh key stored in 1Password? Is it a file there, a blob of text in a note field, etc?
    – negacao
    Commented Feb 5, 2021 at 13:34
  • 1
    That is your public key, not your private key. The private one should start with a line -----BEGIN OPENSSH PRIVATE KEY-----. You will need the private key to authenticate to those remote systems. There is a good explanation of public vs private keys here: ssh.com/ssh/public-key-authentication
    – negacao
    Commented Feb 5, 2021 at 19:47
  • 1
    If you are using 1password 8 then you can store your ssh keys in it developer.1password.com/docs/ssh . Thus use 1password on both machines. But note the encrypted data wioll be stored on 1passwords servers which should be secure enough but I can image cases where that external storage would not be accepted.
    – mmmmmm
    Commented Oct 15, 2023 at 21:52

1 Answer 1

2
  1. Just copy your old key (typically id_rsa (private key) and id_rsa.pub (public key)) to your new computer to ~/.ssh/

  2. make sure to have the right permissions with chmod 400 ~/.ssh/id_rsa

  3. then add the key using ssh-add for example

ssh-add ~/.ssh/id_rsa

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .