MSYS2-packages
MSYS2-packages copied to clipboard
git bash unable to create key. when i put passphrase and then they said failure.
SHAHIN@DESKTOP-S3VBMK0 MINGW64 ~/Desktop/mygitkey (master) $ ssh-keygen -t rsa -b 4096 -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/SHAHIN/.ssh/id_rsa): mykey Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in mykey Your public key has been saved in mykey.pub The key fingerprint is: SHA256:BMQGznnnkO43yn8Gm1SCQSfJPBYTpQ6IUhS5vIIshTs [email protected] The key's randomart image is: +---[RSA 4096]----+ | .+o.BO=o | | o.+ .XB | |oo..=o=+o | |o + =.=. . | |oo . o So | |E.. . o | |.o ..o+ | | . oo.o | | o..o | +----[SHA256]-----+
SHAHIN@DESKTOP-S3VBMK0 MINGW64 ~/Desktop/mygitkey (master) $ eval "$(ssh-agent -s)" Agent pid 653
SHAHIN@DESKTOP-S3VBMK0 MINGW64 ~/Desktop/mygitkey (master) $ ssh-add -K /Users/you/.ssh/id_rsa Enter PIN for authenticator: Provider "internal" returned failure -1 Unable to load resident keys: invalid format
I'm facing the same issue and would appreciate any suggestions?
From what I remember, all I needed to do was ssh-keygen ...
and just use ssh, I don't think I ever had to use ssh-agent or ssh-add, but either way, I think the last command is incorrect as that looks like it came from a macOS tutorial, it should probably be ssh-add -K ~/.ssh/id_rsa
2 things:
- You should replace
/Users/you/
by your actual user folder location. Probably you can just replace it by~
, which is the current's user folder location. - Try with
ssh-add -k ~/.ssh/id_rsa
(small k instead of capital K)
thanks @sergiobdrl ,for a moment I would say "hey wait man I looked the man page and the K is for .." and re read-it and yes, below that is the minus k solves the invalid format issue...
Regards,
SHAHIN@DESKTOP-S3VBMK0 MINGW64 ~/Desktop/mygitkey (master) $ ssh-keygen -t rsa -b 4096 -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/SHAHIN/.ssh/id_rsa): mykey Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in mykey Your public key has been saved in mykey.pub The key fingerprint is: SHA256:BMQGznnnkO43yn8Gm1SCQSfJPBYTpQ6IUhS5vIIshTs [email protected] The key's randomart image is: +---[RSA 4096]----+ | .+o.BO=o | | o.+ .XB | |oo..=o=+o | |o + =.=. . | |oo . o So | |E.. . o | |.o ..o+ | | . oo.o | | o..o | +----[SHA256]-----+
SHAHIN@DESKTOP-S3VBMK0 MINGW64 ~/Desktop/mygitkey (master) $ eval "$(ssh-agent -s)" Agent pid 653
SHAHIN@DESKTOP-S3VBMK0 MINGW64 ~/Desktop/mygitkey (master) $ ssh-add -K /Users/you/.ssh/id_rsa Enter PIN for authenticator: Provider "internal" returned failure -1 Unable to load resident keys: invalid format
and please the part where they said to enter the pin for the authenticator. what pin are they exactly referring to? is it my system pin?
@EmmanuelEyo if you didn't enter any passphrase during the creation of the key then your PIN/Passphrase should be empty. Pressing "enter" on the keyboard should work just fine.
One thing I notice is, if you use this code: ssh-add -K ~/.ssh/id_rsa
or ssh-add -K ~/.ssh/id_ed25519
you get an error with PIN authenticator so rather change the "K" to a lowercase ie. ssh-add -k ~/.ssh/id_rsa
or ssh-add -k ~/.ssh/id_ed25519
and press "enter" if passphrase is requested. That should solve it.