I tried following along with this article “https://www.digitalocean.com/community/articles/how-to-create-ssh-keys-with-putty-to-connect-to-a-vps” and this article “https://www.digitalocean.com/community/articles/initial-server-setup-with-ubuntu-12-04” to set up ssh with my already existing droplet. Every time I go to putty to ssh in, I get a “server refused our key” message and then I am asked to enter in my password. I must be doing something wrong or have the wrong configuration but I’m not sure what it is. I have re-read both articles many times in order to figure out where I am (possibly) missing something.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
CORE OS Solution:
If using coreos set the username ‘core’ instead of ‘root’.
Once you’ve logged in you can use ‘sudo -i’ to become root.
Just check your secure log. In my case (Centos) the file is locate in /var/log/secure.
In my log: Jan 24 16:52:40 server sshd[19625]: Authentication refused: bad ownership or modes for directory /home/user
After I changed the modes /home/user from 0755 to 0700 I can login with the key.
These are the steps to setup putty ssh login profile, hope this help <br>========================================= <br>ssh-keygen -t rsa -b 2048 -f mykey -C [me@domain.com < your comment] <br>cat mykey.pub >> ~/.ssh/authorized_keys <br>========================================= <br>download mykey <br>download PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html <br>start puttygen <br>go to conversion > import key <br>select downloaded mykey <br>Then [Save private key], you can change key comment if needed <br>========================================= <br>Start putty <br>Key in the host name/ip address together with port, if non standard port is used <br>Then go to [connection] > [ssh] > [auth] <br>Click [Browse] of [Private key file for authentication], choose the previous generated [mykey.ppk] <br>Go back to [Session] <br>Enter the name you want at [Saved sessions] field, then [Save] <br>After all that, hit [Open] <br>Enter your user name when prompted, your should be logged in now <br>========================================= <br>Remeber to remove the generated key files from the server <br>rm mykey mykey.pub <br>========================================= <br>If everything is good, follow the article you mentioned to disable the ssh password login.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.