AWS EC2 Permission denied (publickey,gssapi-keyex,gssapi-with-mic

Issue:

 ssh -i "key-aws.pem" ec2-user@ec2-IP.compute-1.amazonaws.com

IP: 10.0.0.1

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for key-aws.pem are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: key-aws.pem
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

[vagrant@vagrant-centos65]$ chmod 400 key-aws.pem
[vagrant@vagrant-centos65]$ ls -ltr key-aws.pem
-r-xr-xr-x 1 vagrant vagrant 1692  key-aws.pem

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0555 for 'key-aws.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: key-aws.pem
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Solution:

Follow the below steps and it will resolved for sure;
1. Copy the key-aws.pem into /home/vagrant/.ssh/
    cp key-aws.pem /home/vagrant/.ssh/
2. Change the file permission to read for that user only.
     chmod 400 /home/vagrant/.ssh/key-aws.pem
     [vagrant@vagrant-centos65]$ ls -ltr /home/vagrant/.ssh/
     -r-------- 1 vagrant vagrant 1692 key-aws.pem
3. Execute ssh command now.
    ssh -i "/home/vagrant/.ssh/key-aws.pem" ec2-user@ec2-IP.compute-1.amazonaws.com   

Happy learning and implementation!!

12 comments:

  1. Decent post. I learn something absolutely new and testing on sites I earthcycle consistently. It's consistently valuable to peruse articles from different writers and work on something from different destinations.

    ReplyDelete
  2. Decent post. I learn something absolutely new and testing on sites I earthcycle consistently. It's consistently valuable to peruse articles from different writers and work on something from different destinations.

    ReplyDelete
  3. Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me.
    AWS Training in Chennai

    ReplyDelete
  4. Hello
    Please i just took up LABRADOR PUPPIES breeding as a hobby after my mom passed away because they were her favorite PUPPIES. Despite the fact that they are very intelligent, am finding it very difficult getting them to mate.
    For any information CLICK HERE ENGLISH LABRADOR PUPPIES FOR SALE.THANKS

    ReplyDelete
  5. Hello
    Please i just took up LABRADOR PUPPIES breeding as a hobby after my mom passed away because they were her favorite PUPPIES. Despite the fact that they are very intelligent, am finding it very difficult getting them to mate.
    For any information CLICK HERE LABRADOR PUPPIES FOR SALE.THANKS

    ReplyDelete
  6. Hello
    Please i just took up LABRADOR PUPPIES breeding as a hobby after my mom passed away because they were her favorite PUPPIES. Despite the fact that they are very intelligent, am finding it very difficult getting them to mate.
    For any information CLICK HERE http://championlabradorhomes.company.com/. THANKS

    ReplyDelete
  7. Ucuz, kaliteli ve organik sosyal medya hizmetleri satın almak için Ravje Medyayı tercih edebilir ve sosyal medya hesaplarını hızla büyütebilirsin. Ravje Medya ile sosyal medya hesaplarını organik ve gerçek kişiler ile geliştirebilir, kişisel ya da ticari hesapların için Ravje Medyayı tercih edebilirsin. Ravje Medya internet sitesine giriş yapmak için hemen tıkla: www.ravje.com

    İnstagram takipçi satın almak için Ravje Medya hizmetlerini tercih edebilir, güvenilir ve gerçek takipçilere Ravje Medya ile ulaşabilirsin. İnstagram takipçi satın almak artık Ravje Medya ile oldukça güvenilir. Hemen instagram takipçi satın almak için Ravje Medyanın ilgili sayfasını ziyaret et: instagram takipçi satın al

    Tiktok takipçi satın al istiyorsan tercihini Ravje Medya yap! Ravje Medya uzman kadrosu ve profesyonel ekibi ile sizlere Tiktok takipçi satın alma hizmetide sunmaktadır. Tiktok takipçi satın almak için hemen tıkla: tiktok takipçi satın al

    İnstagram beğeni satın almak için Ravje medya instagram beğeni satın al sayfasına giriş yap, hızlı ve kaliteli instagram beğeni satın al: instagram beğeni satın al

    Youtube izlenme satın al sayfası ile hemen youtube izlenme satın al! Ravje medya kalitesi ile hemen youtube izlenme satın almak için tıklayın: youtube izlenme satın al

    Twitter takipçi satın almak istiyorsan Ravje medya twitter takipçi satın al sayfasına tıkla, Ravje medya güvencesi ile organik twitter takipçi satın al: twitter takipçi satın al

    ReplyDelete

Please provide your input, it will honer for me...