When trying to log in as root (with public key) to an Ubuntu 14.04 LTS box, the OpenSSH server will just say
Server refused public-key signature despite accepting key!
I have enabled root login by setting PermitRootLogin
accordingly and have also restarted SSH with /etc/init.d/ssh restart
.
I have also verified that this specific error would not occur if my key were wrong or not in /root/.ssh/authorized_keys
.
Why can't I log in ?
Disclaimer: Yeah, I know that using a root account on Ubuntu is not the proper way to do it, but I was told to. Meh.
Apparently the problem lies with the seemingly innocuous
/etc/init.d/ssh restart
.Although it does not print any errors, it will simply not restart / reload the server, therefore root login is not yet enabled.
The solution is to just use
service ssh restart
. Duh.I know that the
/etc/init.d
way is deprecated but as long as it is still supported I'd prefer using it though.Ubuntu's service script should at least fail rather than do nothing, ah well.