0

I am getting Error When Trying to access ec2 instance using SSH . Showing me Error "No Supported Authentication Method Available ( Server Send Public Key )

While i was Working on SSH Unfortunately i gave 777 permission to All Directory and then i am getting this Issue

Wish will get Solution

enter image description here

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
user2255224
  • 79
  • 1
  • 7
  • Not Sure what you mean . I was Working in SSH . After changed the Whole Directory Permission FTP stopped Working and exit SSH and Then again i can't access SSH . Showing Me Error i mentioned above – user2255224 Feb 11 '16 at 17:12

2 Answers2

1

IMHO the chmod 777 has given too lax permissions to the .ssh directory that contains the authorized_keys file. For this reason no ssh, scp or sftp access will work.

To fix it, detatch the EBS volume from the instance, mount it on another instance, fix the permissions and reattach it again

Vorsprung
  • 32,923
  • 5
  • 39
  • 63
  • Do you have a reference for that behavior? It seems like a smart security measure, but I have never heard of it before. – Eric J. Feb 11 '16 at 17:33
  • I have Installed SSL Certificate so Much Works i have Done in my website . All will be Keep Same i have the PEM files Just need to Change the Permission http://stackoverflow.com/questions/8193768/trying-to-ssh-into-an-amazon-ec2-instance-permission-error/35345357 here mentioned a Command "chmod 400 mykey.pem" as if i can't access SSH so how i will give this Command – user2255224 Feb 11 '16 at 17:39
  • Yes @ Eric J i changed the Permission for all Directory by Mistake and After Then i am not able to access using SSH and FTP – user2255224 Feb 11 '16 at 17:42
  • @EricJ. the man page says "the recommended permissions are read/write for the user, and not accessible by others." plenty of anecdotal info that this is actually enforced as a necessary condition – Vorsprung Feb 11 '16 at 21:31
  • @Vorsprung I detatched the EBS for my instance,Attach my EBS to another new instance and Replaced New key http://blog.celingest.com/en/2013/11/14/replace-lost-keypair-ec2-instance/ https://www.youtube.com/watch?v=PhvfXMDICDo And After that When trying to access instance using new keys in SSH it's Still Showing Same Error – user2255224 Feb 11 '16 at 22:11
  • @Vorsprung will you Please tell me how i will change permission for EBS Where my original file located . I have attached my EBS to New Instance . How i will fix permission – user2255224 Feb 11 '16 at 22:35
0

Okay So Finally I am able to Solve this Issue and How ?

What i did ?

I create New Instance in Same Location ( us-west-2c ) and Detach my Original Disk and Attach with new instance . Then Change the Permission of Keys like

got help : http://blog.celingest.com/en/2013/11/14/replace-lost-keypair-ec2-instance/ https://www.youtube.com/watch?v=PhvfXMDICDo

Just Do't need Cat command . After mount use Cd /mst/recovery and then Type command to give right permission

Wish it will help someone like me who made a great mistake

user2255224
  • 79
  • 1
  • 7