I am renting a VPS running CentOS Stream 8, for which I set up SSH pubkey authentication for the user "foo". I access it via PuTTY on Windows.
Recently I rented another VPS running Rocky Linux 9, and I set up sshd in an identical way, then copying the /home/foo/.ssh/authorized_keys file from the old VPS to the new one. In this way I had just to clone the PuTTY profile configuration, changing only the IP address from the old to the new one, and reusing PuTTY's PPK key.
However, when I SSH to the new server via PuTTY, I get the error:
Using username "foo".
Authenticating with public key "[email protected]"
Server refused public-key signature despite accepting key!
Using keyboard-interactive authentication.
Password:
and I have to enter "foo" user's password. However, I'd like to ditch password-based authentication, as in the old server.
The private and public keys are the same on both ends. SELinux is not interfering here. Permissions of ~/.ssh and ~/.ssh/authorized_keys are correct.
Note that SSHing in via pubkey from the new server to itself works perfectly. Clearly in this case it uses id_rsa, not PuTTY's PPK key.
dmesg and /var/log/messages do not show anything useful.
What could be the problem?
Note: this is not a duplicate of Server refused public-key signature despite accepting key - putty , as none of the answers apply.