Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

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?

1 Answer

0 votes
by (44.3k points)

First, log in as the ec2-user:

ssh -i yourkey.pem [email protected]

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
1 answer
asked Jul 10, 2019 in AWS by Amyra (12.9k points)

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
asked Jul 5, 2019 in AWS by Amyra (12.9k points)
0 votes
1 answer

Browse Categories

...