Why I can't loggin with putty

March 20, 2017 315 views
Ansible CentOS

I created a droplets ,it is centos and with the SSH key; but i can't login by the putty with my private key.

Using username "root".
Server refused our key
Using keyboard-interactive authentication.

1 comment
  • I am having the same problem, a few hours ago it was working ok, I already tried reinstalling SSH using the online console, also tried reinstalling putty, but still does not work

1 Answer

Alright, this is the way I solved it:

1.- Paste your PUBLIC ssh key in http://pastebin.com and get the raw version of your paste, example:
http://pastebin.com/raw/Xb1PY53SD (If you dont remember your public key, simply load your private key into PuTTYgen and copy the content that says "public key for pasting into OpenSSH authorized_keys file")

2.- Then login to the online console and find your authorizedkeys file, it is by default in "~/.ssh/authorizedkeys" (the ~ stands for your HOME enviroment variable in my case it is "/root")

3.- In the folder where is your authorizedkeys file execute this command: ```wget ' http://pastebin.com/raw/yourrawid' -O authorizedkeys``` (remember to replace the raw pastebin link with your own)

Hope it helps

Have another answer? Share your knowledge.