Comments (12)
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.
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.
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?
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.
Do not struggle with this. ssh-add in MacOS only store passphrase in keychain. not the key itself.
from ssh-keys-in-macos-sierra-keychain.
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.
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.
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.
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
(orssh-add --apple-use-keychain
). After thatssh-add -A
(orssh-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.
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...
from ssh-keys-in-macos-sierra-keychain.
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.
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.
from ssh-keys-in-macos-sierra-keychain.
Related Issues (11)
- keys must be added with absolute paths HOT 1
- multiple identities HOT 4
- Add `IgnoreUnknown UseKeychain` to work with older versions of OpenSSH HOT 1
- MacOs Mojave Update Request HOT 1
- Document improvements HOT 7
- ssh-add -K and -A throw illegal option HOT 6
- Document changes in 10.12.2? HOT 2
- I'd suggest mentioning GIT_SSH HOT 1
- Multiple identities in .ssh/config results in Too many authentication failures for root HOT 2
- Simpler config suggestion? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh-keys-in-macos-sierra-keychain.