Login vis SSH not possible (no user)

What type of hardware are you using: Virtual machine
What YunoHost version are you running: 12.0.7 (stable)
How are you able to access your server: SSH

Describe your issue

On a new installation (ynh 12.3) I tried to work through the security checklist. I have created a ssh key as described and added it to the server. When I try to login it does not work and I have to enter my password. In the auth.log I see:

2024-12-08T09:51:14.182498+00:00 cogneon sshd[36263]: Connection from XX.XX.XX.XX port 55386 on IP.IP.IP.IP port 22 rdomain ""
2024-12-08T09:51:14.330220+00:00 cogneon sshd[36263]: Failed publickey for USERNAME from IP.IP.IP.IP port 55386 ssh2: RSA SHA256:Ry8dmw5BCulxVncjB/mJhwGMH0E6ie/bSMpGAqDGD1A

What might the problem be?

Share relevant logs or error messages

NA

Hello Simon,

It looks like you have an issue with your public key (SSH key).

Have you created your ssh key? Can you confirm it is present by checking that the filesid_rsa.pub and id_rsa are present in ~/.ssh/ on you local machine (not on the server). They are your public and private keys. Only the public key should be shared with your server.
TO check if you shared it correctly with your server, please verify on your server that the file ~/.ssh/authorized_keys has a line containing the value contained in the file from your computer .ssh/id_rsa.pub. If not, this might be the cause of your problem. To solve this issue, run the command ssh-copy-id -i ~/.ssh/id_rsa.pub <user>@<server> on your local machine
You should be able to connect to your server with ssh <user>@<server> or ssh -p <new port> <user>@<server> if you changed the port.

If all of this is correct, something I found on Internet is that you might connect to your server with OpenSSH which makes using RSA deprecated (https://www.openssh.com/txt/release-8.2)
To solve this you can generate a new pair of SSH keys with ssh-keygen -t ed25519 -C "your_email@example.com" and then you will have 2 files .ssh/id_ed25519.pub and .ssh/id_ed25519 on your local machine. Similarly to what you did with your RSA key, you can run the command ssh-copy-id -i ~/.ssh/id_ed25519.pub @>server>.
It should finally work.

Hope it helps.

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