How to fix Permission Denied (Public key) error?

As you have noted, the Fedora box you are logging in to was not set up to allow password authentication, only public key authentication - this can be seen from the ssh -v result.

So one solution is to add password authentication, as you have done.

The other method would be to take the contents of ~/.ssh/id_rsa.pub on the Ubuntu box and add it to the file ~/.ssh/authorized_keys on the Fedora box.

Now that you have password authentication enabled, you can install the authorized key with this command on the Ubuntu box:

$ ssh-copy-id fedora_box

Sorry all, it appears to be my mistake. I did not have

PasswordAuthentication yes

on the Fedora machine's SSH configuration.

Solved it by enabling this. Thanks for your help.


For me I had to comment out ChallengeResponseAuthentication no ontop of having PasswordAuthentication yes on.

Tags:

Ssh