git in the terminal works fine but Sublime Merge I am getting permissions errors.
First:
The private key has been generated with Git 2.19.2, meaning an openssh 7.8+, which has just changed its private key default format, from PEM (64 characters per lines) to "OPENSSH" (70 characters per lines).
See "Jenkins: what is the correct format for private key in Credentials"
Try and regenerate a private key (and register it on GitLab), but this time with:
ssh-keygen -m PEM -t rsa -P "" -f mynewkey
That is to rule out any interpretation error of that key by Sublime Merge.
Second, as the OP discussed here, SSH private keys with passphrase don't seem to be supported, unless the ssh-agent is properly configured to cached said passphrase.
KeyChain on macOS handles everything for me (without any ssh config; I'm still using the default id_rsa for all of my repos).
The OP bryan confirms in the comments:
I finally got it working with:
ssh-add -K ~/.ssh/[your-private-key]
As explained on GitHub:
The -K
option is in Apple's standard version of ssh-add
, which stores the passphrase in your keychain for you when you add an ssh key to the ssh-agent.