0

I launched a free tier Linux instance in Singapore region. But unable to connect with ssh using pem key. Only newly launched instance have this problem.

The error shows below,

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Thanks in advance.

Regards, Eleena Jose

Eleena jose
  • 47
  • 2
  • 5
  • Possible duplicate of [How to setup SSH Access for Amazon EC2 instance?](https://stackoverflow.com/questions/6394762/how-to-setup-ssh-access-for-amazon-ec2-instance) – Kush Vyas Mar 21 '18 at 11:51

3 Answers3

0

Try changing the permissions of the pem file. If you are using linux, then the following might work:

chmod 400 keyname.pem
Anshul Verma
  • 1,065
  • 1
  • 9
  • 26
0

There is a step by step guide on how to connect to an AWS linux instance. You need to have a ppk file generated from the pem file (use PuttyGEN) and use it to ssh using PUTTY to linux instance. (this is if you are connecting from your windows ). Please use steps below:

For connecting from your local linux computer to Linux EC2 : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html

For connecting from your local windows computer to Linux EC2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

Anish Mohile
  • 183
  • 1
  • 1
  • 10
0

If you've tried all the standard solutions described in the documentation, try deleting the known_hosts file in your ~/.ssh directory as contents may have been corrupted.

rm ~/.ssh/known_hosts
Justin Leto
  • 103
  • 2
  • 9