in Education by
I've created a new linux instance on Amazon EC2, and as part of that downloaded the .pem file to allow me to SSH in. When I tried to ssh with: ssh -i myfile.pem I got: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for 'amazonec2.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: amazonec2.pem Permission denied (publickey). Following this post I tried to chmod +600 the pem file, but now when I ssh I just get: Permission denied (publickey). What school-boy error am I making here? The .pem file is in my home folder (in osx). It's permissions look like this: -rw-------@ 1 mattroberts staff 1696 19 Nov 11:20 amazonec2.pem Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Your key pair file should not be publicly viewable for SSH to work. The key pair file should be in read only mode and available for the owner only. You can run the following command to resolve this issue: chmod 400 mykey.pem

Related questions

0 votes
    I'm working to set up Panda on an Amazon EC2 instance. I set up my account and tools last night and had no ... would be a great help! Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I want to use my Amazon ec2 instance but faced the following error: Permission denied (publickey). I have ... denied (publickey) Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to ... because of memory issues. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I just signed up for Amazon's new Elastic Beanstalk offering. What I can't figure out is how to SSH to a ... instance on my behalf. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I need to know of any way to access a running instance in Amazon EC2. I DON'T have the original keypair ". ... or assign a new keypair? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I need to know of any way to access a running instance in Amazon EC2. I DON'T have the original keypair ". ... or assign a new keypair? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I was given AWS Console access to an account with 2 instances running that I cannot shut down (in production). ... into the instances? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can ... instance's key pair. Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created ... it can be prevented? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I need SSH access to an Amazon EC2 instance running Ubuntu. All I have is the Amazon username and password. Any ideas? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    The question as the title. Why is this, I have used the ssh command: ssh -i mykey.pem root@xxx-xxx-xx-xx-xxx ... What am I doing wrong? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to upgrade my Amazon EC2 micro (t1.micro) instance to large. Please help. Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    We have a large ec2 instance running in Asia pacific region. We want to reserve that particular instance.In aws ... out on something Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am trying to stop an Amazon EC2 instance and get the warning message Warning: Please note that any data on ... Amazon EC2 instance? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I have my instance of the Amazon AWS running, the test page is up. I am trying to SFTP the files to ... move them, permission denied. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
...