IntelliJ 2019.1.3 - Can't access git using SSH keys

Answered

I'm trying to clone a git project from bitbucket using SSH keys. Project pulled as expected when using Git cli or Eclipse git plugin, but I can't figure out how to do that using IntelliJ. The project url is ssh://baraktheking@bitbucket.org/company/affiliation.git (VCS -> checkout from version control -> Git), the error I get is:

baraktheking@bitbucket.org: Permission denied (publickey). Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Where should I configure the ssh keys in the IDE so it will identify them? The git settings screen looks like this:

 

 

Thanks for any help.

0
3 comments

Solved - had to edit C:\Program Files\Git\etc\ssh\ssh_config with the details:

Host bitbucket.org
    IdentityFile C:\Users\User\Dropbox\work\baraktheking_bitbucket_key

9

I'm connecting to a Linux box with private key SSH authentication (not bitbucket).

This in ssh_config works in Windows when "id_rsa" file is in C:\Users\myname\.ssh\ 

 IdentityFile ~/.ssh/id_rsa
2

Please sign in to leave a comment.