I cannot login to my server by SSH keys.
I copied public key name.pub to my server using ssh-copy-id. If I then run ssh -i name.key root@server
, I have to insert the server's password instead of being authenticated by key.
The output of running debug mode sshd on a custom port is here.
I have checked several questions (removed because this is marked as spam) where the accepted answer was about rights issues, but I don't think I have such issue. My desktop does not complain about keys being too open, and the .ssh folder and authorized_keys on the server have rights 700 and 600 respectively.
One final remark is that the keys are generated with ssh-keygen -m pem
, and the public key is changed to PEM format using ssh-keygen -f name.key -e -m pem > name.pub
Why is it not possible for SSH to authorize me by SSH key, and how can I resolve this?
ssh -vv
and inspect the debug output)?ssh-keygen -m pem
create the.pub
file that would be required forssh-copy-id
already? but I agree with the above, the verbose output from the client will probably shed more lightssh-keygen -m pem
will create one private keyfile with thename
of your choice and aname.pub
in the same directory -- BUT that file is not in theBEGIN RSA PUBLIC KEY
format, but in thessh-rsa
format, which is what the second command does. It's possible that this is the format required, I think for example Oracle Cloud wants this.