3

I have an AWS Linux Instance with a LinuxDemo.pem key. I can access it from my own workstation no problem. But if I try and access it from home or if another colleague tries to we get the following result;

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'LinuxDemo.pem' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: LinuxDemo.pem
Enter passphrase for key 'LinuxDemo.pem':
Permission denied (publickey).

Now the same command is ran on all workstations - ssh -i LinuxDemo.pem ec2-user@<IP_Address>

How can I make it that a others can access this Instance as this is important.

Dan
  • 2,020
  • 5
  • 32
  • 55
  • possible duplicate of [Trying to SSH into an Amazon Ec2 instance - permission error](http://stackoverflow.com/questions/8193768/trying-to-ssh-into-an-amazon-ec2-instance-permission-error) – Uri Agassi May 04 '14 at 12:03

3 Answers3

3

You need to change the permissions on your PEM key on the other computers:

chmod 0400 LinuxDemo.pem

See Trying to SSH into an Amazon Ec2 instance - permission error

Community
  • 1
  • 1
Uri Agassi
  • 36,848
  • 14
  • 76
  • 93
1

If you dont own the private key. Adding it to your ssh agent will do the trick

eval `ssh-agent -s`
ssh-add LinuxDemo.pem
ssh user@host
Kenichi Shibata
  • 148
  • 2
  • 11
0

Your error clearly states that it has bad permission. All you need to do is change the permission of pem file to 0400 and then try to ssh again.

chmod 0400 LinuxDemo.pem

Prash
  • 558
  • 5
  • 8