0 votes
1 view
in AWS by (19.2k 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.6k 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 (9.4k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...