Error connecting to github over ssh. MATLAB only works with the old rsa encryption but github deprecated it
14 views (last 30 days)
Show older comments
Hey guys,
I'm using github over ssh for source control and for a while it was okay.
However, this week I started receiving the following error message when trying to pull / push:
Git internal error (Code = -20, Class = 23): ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
I've tried deleting the old key and generating a new key with different encryption (ECDSA) but I get the following error:
Git internal error (Code = -1, Class = 23): Failed to authenticate SSH session: Unable to open public key file
P.S. I'm using MATLAB 2021a, windows 11, with cygwin and with no external ssh client.
Would greatly appreciate any help!
2 Comments
camille catalano
on 13 Apr 2022
Hi,
I've got the same issue but I tried with MATLAB 2021a, 2021b and 2022a and with ed25519 and ECDSA.
I'm using windows 10.
Thurston Brevett
on 5 Jun 2022
I have the same issue on ubuntu with R2021b
I've deleted my RSA keys and replaced them with ecdsa and ed25519 keys. System calls within the MATLAB environment i.e. !git fetch or !git push work flawlessly, but the integration (i.e. using the file explorer or project view) does not. I followed the instructions here to manually direct MATLAB to the key I wanted to use, and I also tried set ting the KeyHasPassphrase property to true even though the passphrase is empty.
It's as if MATLAB is using it's own git client and authentication first, because otherwise, I don't understand how there's an RSA authentication error when I don't have any RSA keys.
Answers (1)
Esha Chakraborty
on 12 Apr 2022
Hi Sharon,
I understand that you are encountering error in connecting to GitHub over ssh when using MATLAN R2021a.
In MATLAB R2021a, we don't handle ssh keys with passphrases. This is fixed in MATLAB R2021b. To work around, you can use Pageant as your ssh-agent or use a key without a passphrase.
Consider setting "passphrase" to 'on', and you should be able to communicate with Pageant via the following command:
settings().matlab.sourcecontrol.git.UseSSHAgent
This is likely to resolve your issue.
0 Comments
See Also
Categories
Find more on Source Control in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!