Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to negotiate with __IP_ADDRESS_ port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

While using git clone in PhpStorm, I got an error message:

Clone failed
Unable to negotiate with IP ADDRESS port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

I then made my own RSA key in and saved it on my computer; also registered it on the server (by server host) where I wanted to get git clone. I've also downgraded my latest PhpStorm version. As a last resort I have also reset my computer and reinstalled PhpStorm.

But I still have that error message in my PhpStorm event log.

Plus, when I first got PhpStorm, I could easily get clone successfully, but suddenly after days, I've got event log entries like that.

Can I get a solution about this, OTL

like image 595
Still here Avatar asked Jan 30 '26 18:01

Still here


2 Answers

On Linux/Ubuntu I added the following lines to /etc/ssh/ssh_config:

    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa

I guess it is equivalent (and better) to put the same lines in a separate file in /etc/ssh/ssh_config.d.

like image 92
Paolo Mascellani Avatar answered Feb 02 '26 08:02

Paolo Mascellani


Add PubkeyAcceptedAlgorithms +ssh-rsa and HostkeyAlgorithms +ssh-rsa attributes.

nano ~/.ssh/config
Host hostname_of_machine
    HostName hostname_or_ip_address
    User root
    IdentityFile ~/.ssh/file.pem
    IdentitiesOnly yes
    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa
like image 23
Antonio Moreno Avatar answered Feb 02 '26 09:02

Antonio Moreno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!