Question

I have a machine in AWS EC2 platform. Its a linux platform, with the user named root having no password,

Now I have to setup, ssh key authentication on this machine, For that firstly, I installed cygwin, then I followed the following steps :

 1. ssh-keygen -t dsa -f ~/.ssh/<key name> -C "root@<ip>"
 2. cat ~/.ssh/<key name>.pub | ssh  root@<ip> "cat >> ~/.ssh/authorized_keys"

Now, when I do this, it asks for password, but I never setup any password on the user root.

Also if I does not supply password, it says access denied!!!

Where is the problem?

Was it helpful?

Solution

Check the permissions on your ~/.ssh/authorized_keys they need to be 600 and also on the ~/.ssh directory, they need to be 700.

Also you can run your sash client with the -vvv option to get debug information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top