SSH connection error only in Matlab 2021a

9 Ansichten (letzte 30 Tage)
Alex
Alex am 8 Nov. 2021
Beantwortet: Chetan am 8 Mai 2024
Dear Matlab-Community,
Whenever I try to connect to my GitLab instance using SSH with Matlab 2021a, I get an error git error (see below). Using SSH in the terminal works fine on all 4 PCs (Windows 10), however using SSH through Matlab doesn't work. This appears to be limited to MATLAB2021a, as one of the machines also runs MATLAB2019b, in which no issues occur and a ssh connection can be established and files can be uploaded and/or pulled.
Error-Message:
Git internal error (Code = -1, Class = 23): Failed to authenticate SSH session: Unable to open public key file
What has been done so far:
ssh-keygen -t rsa -b 4096 -m PEM
  • Tried various machines (4), which all lead to the same issue
  • Check "HOME" and "USERVARIABLE" systemvariables.
  • Installed MATLAB2019b to check for isssues with versions --> No issues using this version; ssh connection can be established
  • Checking ssh connection from terminal --> all workds nicely.
Thanks for our help!
  2 Kommentare
Olivier Megel
Olivier Megel am 11 Nov. 2021
Hi Alexander,
I am facing a similar issue although with Matlab 2021b. It works fine on 2019a. Did you manage to solve the issue in the end?
Best,
Olivier
Alex
Alex am 11 Nov. 2021
Hi Olivier,
So far I could't solve the problem. I updated my MATLAB R2021a - Update 5, but this didn't change anything.
Best,
Alexander

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chetan
Chetan am 8 Mai 2024
Hi @Alex,
I understand that you're encountering an issue when trying to connect to your GitLab instance via SSH within MATLAB 2021a, with an error message indicating a failure to authenticate the SSH session due to the inability to open the public key file.
It appears MATLAB is not detecting the SSH keys. As a workaround, you can explicitly set the path of your PEM file and personal private key with the following commands:
git = settings().matlab.sourcecontrol.git;
git.PrivateKeyFile.PersonalValue = '/path/to/key';
git.PublicKeyFile.PersonalValue = '/path/to/key.pub';
Additionally, you can follow the steps outlined in the MathWorks Documentation linked below for further guidance:
Hope this helps!

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by