Permission denied (public key) on ssh connection to a docker

285 Views Asked by At

I am trying to setup an ssh connection to a docker using ssh keys, i have used ssh_keygen and copied the .pub file to ~/.ssh/authorized_keys in the container, however i get the following error on connection

[email protected]: Permission denied (publickey).

I have done this following the ssh manual page so I struggle to understand why my keys wont pass.

Container side my home is set as /root, which is why I put it in the /root/.ssh/authorize_keys folder.

I also modified the sshd_config file following options:

PermitRootLogin yes
PasswordAuthentication no
PermitEmptyPasswords no

I had tried setting PermitEmptyPasswords and PasswordAuthentication to yes but would still be refused login if i just gave an empty string as password.

What am i missing here?

0

There are 0 best solutions below