Giter VIP home page Giter VIP logo

Comments (12)

newtonne avatar newtonne commented on September 4, 2024 26

I'm experiencing an issue that ssh-add -K silently doesn't add non passphrase protected keys to the keychain (though it works fine for password protected keys). I'm on High Sierra.

A workaround for this is to add a passphrase to the key temporarily:

ssh-keygen -p -f ~/.ssh/id_rsa
# when prompted, input a temporary password

Next, add the key to the agent (and Keychain) using ssh-add -K. Then, remove the passphrase from the key:

ssh-keygen -p -f ~/.ssh/id_rsa
# when prompted for a new passphrase, leave it blank

The passphrase-less key can henceforth be added to the agent using ssh-add -A.

from ssh-keys-in-macos-sierra-keychain.

jkukul avatar jkukul commented on September 4, 2024 16

and tried to re-add it using ssh-add -K, but now no matter what I do, I cannot get it back into the OSX Keychain app...

@jbarker4682 Is your key passphrase protected? I'm experiencing an issue that ssh-add -K silently doesn't add non passphrase protected keys to the keychain (though it works fine for password protected keys). I'm on High Sierra.

from ssh-keys-in-macos-sierra-keychain.

benpbolton avatar benpbolton commented on September 4, 2024 5

If you simplify your ~/.ssh/config to just:

Host *
  IdentityFile ~/.ssh/id_rsa
  AddKeysToAgent yes

and reboot, then ssh add -K ~/.ssh/id_rsa... do you see your entry in the macos login keychain?

eg. keychain screenshot

Then you should ensure an ssh-add -A comes back clean (I prefer the ssh-add -A plist approach due to ssh-agent forwarding not respecting UseKeyChain)

from ssh-keys-in-macos-sierra-keychain.

wpc009 avatar wpc009 commented on September 4, 2024 2

Do not struggle with this. ssh-add in MacOS only store passphrase in keychain. not the key itself.
image

image

from ssh-keys-in-macos-sierra-keychain.

dmoles avatar dmoles commented on September 4, 2024 2

Following up on @wpc009's comment — the "No identity found in the keychain" message means that those passphrases aren't in the keychain (yet). To get them in there, you need to first use ssh-add -K (or ssh-add --apple-use-keychain). After that ssh-add -A (or ssh-add --apple-load-keychain) should work.

from ssh-keys-in-macos-sierra-keychain.

 avatar commented on September 4, 2024 1

Yes... after adding the key via ssh-add -K, I used ssh -T to connect to github... But this still does not fix my problem...

As an additional step, I removed the key from the mac OSX Keychain app and tried to re-add it using ssh-add -K, but now no matter what I do, I cannot get it back into the OSX Keychain app...

The only thing it seems to do is add the key to the current ssh instance, which as soon as I reboot, is cleared so I have to re-add again... None of the listed "fixes" seem to work for me...

Should I raise a support ticket with Apple?

from ssh-keys-in-macos-sierra-keychain.

 avatar commented on September 4, 2024 1

So, after many months of no resolution, after upgrading to Mac OS High Sierra 10.13.6, I found out that my KeyChain had become corrupted... Per directions I found here I deleted and recreated it... After this, I was able to add my SSH key's automatically by adding ssh-add -A to a startup plist...

from ssh-keys-in-macos-sierra-keychain.

Artein avatar Artein commented on September 4, 2024 1

Following up on @wpc009's comment — the "No identity found in the keychain" message means that those passphrases aren't in the keychain (yet). To get them in there, you need to first use ssh-add -K (or ssh-add --apple-use-keychain). After that ssh-add -A (or ssh-add --apple-load-keychain) should work.

Your suggestion didn't work out to me. I have macos Monterey 12.1 and 4 ssh keys (respectively added to config file).

from ssh-keys-in-macos-sierra-keychain.

 avatar commented on September 4, 2024

The key is already in my keychain... that's why I don't understand why ssh-add -A returns the error message about no identities... It's there and I can see it...

image

from ssh-keys-in-macos-sierra-keychain.

jirsbek avatar jirsbek commented on September 4, 2024

Have you tried to use your SSH key? After running ssh-add -l till the time I actually use the key my ssh agent also got no identites. After using the key agent lists the keys I have used.

from ssh-keys-in-macos-sierra-keychain.

luca-borrione avatar luca-borrione commented on September 4, 2024

In my case there was a clash between my github email and the enterprise email.
I solved creating the ssh key using the enterprise email
ssh-keygen -t rsa -b 4096 -C "[email protected]"
as explained in the guide https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

from ssh-keys-in-macos-sierra-keychain.

soaresvml avatar soaresvml commented on September 4, 2024

image

from ssh-keys-in-macos-sierra-keychain.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.