IntelliJ Settings Repository using ssh authentication
Does not and cannot work for certain SSH setups
The "Settings Repository" support for ssh is limited to the Java jgit implementation. Whereas you can configure new and existing projects to use your OS native ssh, this preference is ignored by the "Settings Repository" feature.
As such any jgit limitations which prevent it from working with your SSH setup will prevent the "Settings Repository" feature from working with no possible workaround.
Settings repository is a separate feature based on the JGit, and it is not related to the Version control - Git, that is why changing settings there has no effect.
Settings repository does not have a Native SSH mode and does not benefit from the ssh-agent.
Dmitriy Smirnov (JetBrains) — Settings Repository feature always asks for SSH key password even though key is in my SSH agent already
I downloaded and was in the process of setting up IntelliJ on a new machine when I ran into problems trying to overwrite my local settings from a settings repository. It seems like it is a problem with how Git is used internally by the settings repository. Below are examples of trying to use the Settings Repository feature and also Clone Repository with both Built-in and Native SSH. I'm not sure how to get this working correctly now.
Vladimir Krivosheev — Settings repository - add Native SSH mode (IDEA-173223)
Settings repository does work with the SSH keys.
Make sure you specify the URL correctly, as [email protected]:username/Repo.git
If your ssh keys are not called id_rsa/id_rsa.pub, make sure they are correctly referenced in the .ssh/config
Also, the error might occur because for some reasons IDE cannot overwrite local config files. Check the IDE logs for any related errors.
This answer possibly doesn't solve your issue but I'll still add it because this page was a first result in Google by "intellij settings repository auth fail" request.
I had an issue with "Auth fail" error when adding settings repository. I faced it after upgrade to macOS Mojave 10.14.1 which provides new version of ssh-keygen binary.
The cause was a new ssh key which I generated with ssh-keygen -t rsa -C "Michael Ledin" -b 4096
command.
Check your private SSH key (usually ~/.ssh/id_rsa
). If it starts with
-----BEGIN OPENSSH PRIVATE KEY-----
then it has new RFC4716 key format which is currently not supported by JGit used by IntelliJ based IDEs.
To solve this issue you can:
either generate new key in old "PEM" format, add
-m "PEM"
option:ssh-keygen -t rsa -C "Michael Ledin" -b 4096 -m "PEM"
or if you already added your public key to ssh remotes and repositories and it's hard to replace it with new key everywhere, then you have two options to convert it to old PEM format:
a) with
ssh-keygen
(it will ask for a new passphrase - use the old one or leave it empty):ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
b) with
putty
first install
putty
and convert private key to SSH2 format (I presume that your current key is stored at~/.ssh/id_rsa
):brew install putty mv ~/.ssh/id_rsa ~/.ssh/id_openssh puttygen ~/.ssh/id_openssh -O private-sshcom -o ~/.ssh/id_ssh2
next convert SSH2 key to PEM:
ssh-keygen -i -f ~/.ssh/id_ssh2 > ~/.ssh/id_rsa rm ~/.ssh/id_ssh2
now you have your private key
~/.ssh/id_rsa
in old PEM format that can be used by IntelliJ based IDEs; the original key is stored in~/.ssh/id_openssh
file and can be removed:rm ~/.ssh/id_openssh
Links that were used to create this answer:
Convert OpenSSH private keys to RSA PEM
ssh-keygen does not create RSA private key