in Education by
The question as the title. Why is this, I have used the ssh command: ssh -i mykey.pem [email protected] But I get that error, find nothing on google. What am I doing wrong? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
First, log in as the ec2-user: ssh -i yourkey.pem ec2-user@host Then use sudo to run the required commands, for example, to edit the files in /etc/hosts file which is owned by root which obviously requires root privileges: sudo nano /etc/hosts Also, to avoid typing sudo every time, use sudo su to become a superuser with root privileges

Related questions

0 votes
    I've created a new linux instance on Amazon EC2, and as part of that downloaded the .pem file to allow me ... Nov 11:20 amazonec2.pem Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
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 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 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 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 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 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
    Any easy way to move and custom AMI image between regions? (North Virginia -> Singapore) I know you can mess up with ... way to do it? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have thought a lot recently about the different hosting types that are available out there. We can get ... added probably. Thanks Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to connect to db on EC2 from my local machine, I am not able to do and have tried everything- I ... to connect to the database Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm running a CherryPy web server at 0.0.0.0:8787 on an EC2 instance. I can connect to the web server ... the EC2 instance for this? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    SSH for my AWS server is not working for Filezilla and Putty. Error: Disconnected : No supported authentication ... /authorized_keys - Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
...