I saw it was possible to use a SSH key (with passphrase) and a password for authentication on: https://security.stackexchange.com/questions/17931/possible-to-use-both-private-key-and-password-authentication-for-ssh-login I have a CentOS 7 remote VPS and a Windows local machine.
I made a
private key (
SSH-2 RSA, 2048 bits with passphrase) with PuTTYgen on my Windows machine.
On CentOS I added the pasteable public key to
~/.ssh/authorized_keys, when I was a root user.
I also changed the permissions of the folder, with:
sudo chmod g-w ~/ && sudo chmod 755 ~/.ssh && sudo chmod 600 ~/.ssh/authorized_keys
Then I changed
Protocol 2 PermitRootLogin yes RSAAuthentication yes PubkeyAuthentication yes PasswordAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys AuthenticationMethods "publickey,password"
And I restarted the SSH server with
sudo systemctl restart sshd.service.
I didn't close Putty on this Windows local machine.
I wanted to check on a other Windows machine if it worked. I added the private ppk file to Pageant, and also pointed it to that file in Putty. But then when I try to open the connection Putty gives this error message:
"disconnected no supported authentication methods available server sent publickey".
What can be the problem, how can I auth with a SSH key (with passphrase) and a root password?