Create and use SSH keys

Hi,

On ubuntu I generated SSH key which created ~/.rsa/id_rsa file and that was it (if I remember correctly). After I was able to use any program that uses SSH keys to connect to servers (like git). I thought that keys inside ~/.ssh are automatically used but apparently not.

I get errors like: Unable to negotiate with … port 22: no matching host key type found. Their offer: ssh-rsa / fatal: Could not read from remote repository.

I also tried to use eval $(ssh-agent) and then => ssh-add ~/.ssh/id_rsa but it doesn’t help

I did something wrong or EOS have some other way to make it work ?

Thanx

That is good.

Did you authorize the key on whatever you are trying to connect to?

The ssh rsa keys have been deprecated and possibly dropped by SSH for security reasons.

https://utcc.utoronto.ca/~cks/space/blog/tech/OpenSSHAndSHA1DeprecationII

The newest most efficient key is ed25519 key.
This probably isn’t the solution to your problem, but I would suggest switching to ed25519 in the near future.

Pudge

1 Like

Yes, I added my public key

hm, I didn’t knew that but for now I’d like to make it work, so is tiresome to connect over https

1 Like

What do the logs on the server side show?

When trying to close git repo from “azure dev ops” using sublime merge I get this:
sm

I double checked that I added the right key to repo

I also tried to create config file inside .ssh with following data:
Host dev.azure.com
HostName dev.azure.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

Are you doing this from a GUI application?

Yes, but I also tried from console and I get:

Unable to negotiate with 40.74.28.27 port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

If you are working from a GUI you probably need the appropriate *-askpass packages installed.

hm… I installed “ksshaskpass-5.24.3-1-x86_64” and then used command ssh-add and got the response: Identity added: home/uros/.ssh/id_rsa but still I can’t connect anywhere

I tested the same key on windows machine on same git repository and works fine, so definitely the problem is on my EOS installation.

I hope one of these might help. Do the following on your id_rsa file

chmod 600 .ssh/id_rsa

Likely, not much help, but may save you issues in future using that key through openssh.

Next, try setting your config file to (backup current, if this doesn’t work)

Host ssh.dev.azure.com
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes

And lastly, are you using the following format?
git@ssh.dev.azure.com:<project>

I hope one of these helps, based on current information provided.

It finally works … and it was nothing wrong on EOS but azure dev ops had some maintenance goings on and because of that I have problems to connect. On windows worked probably because I tested it before I tried on EOS … damn MS

thanx all for help

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.