Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to push code from Vs Code interface to gitlab. Git: [email protected]: Permission denied (publickey,keyboard-interactive)

I'm using mac. My vs code is sorta connected to the gitlab. I can commit the code using VS code interface but not able to push the code to the repo; however, i can push the code using terminal(git push). Not sure how i can make my Vs code push the code without having to open terminal and do git push.

Every time i push the code from vs interface i get the error "Git: [email protected]: Permission denied (publickey, keyboard-interactive)." Let me know if anyone knows about this, thanks.


1 Answers

[email protected] means SSH URL

Try and check what ssh -Tv [email protected] returns when done in the Terminal of VSCode itself.

Check this thread which includes assuming your private SSH key is passphrase-protected):

It is most likely because your SSH key wasn’t “unlocked”.

On Mac after creating an SSH key you can add it to the keychain with:

ssh-add -K ~/.ssh/[your-private-key]

And in ~/.ssh/config you add:

Host *
 UseKeychain yes
 AddKeysToAgent yes
 IdentityFile ~/.ssh/[your-private-key]

So it knows where to look, and this will also make it so you don’t need to enter the passphrase each time, and thus VSCode is allowed to use they key, cause it’s unlocked not just when you’re pushing through CLI

like image 109
VonC Avatar answered Nov 03 '25 06:11

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!