Trying to SSH into an Amazon Ec2 instance - permission error

后端 未结 29 3493
一生所求
一生所求 2020-11-27 08:51

This is probably a stupidly simple question to some :)

I\'ve created a new linux instance on Amazon EC2, and as part of that downloaded the .pem file to allow me to

29条回答
  •  一个人的身影
    2020-11-27 09:23

    Key file should not be publicly viewable so use permission 400

    chmod 400 keyfile.pem
    

    If above command shows permission error use

    sudo chmod 400 keyfile.pem
    

    Now ssh into the ec2 machine, if you still face the issue, use ec2-user

    ssh -i keyfile.pem ec2-user@ec2-12-34-56-78.compute-1.amazonaws.com

提交回复
热议问题