-bash var www html indexfile html Permission denied

0 votes

Hi Guys,

I am trying to append some data in /var/www/html in my EC2 instance. But it is showing me the below error.

$ sudo echo "Welcome" >> /var/www/html/indexfile.html
-bash: /var/www/html/indexfile.html: Permission denied

Can anyone help me to resolve this error?

Jun 16, 2020 in AWS by akhtar
• 38,260 points
5,275 views

1 answer to this question.

+1 vote

Hi@akhtar,

You have to give permission to your ec2-user using chmod command. You can use the below-given command.

$ sudo chmod -R 777 /var/www/html/indexfile.html
$ sudo echo "Welcome" >> /var/www/html/indexfile.html

I hope this will solve your error.

answered Jun 16, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
0 answers
+3 votes
2 answers

Amazon AWS Filezilla transfer says : permission denied

Well, I can't see the screenshot that ...READ MORE

answered May 3, 2018 in AWS by Cloud gunner
• 4,670 points
15,151 views
0 votes
1 answer

Permission denied when I SSH access to EC2 instance

These are common reasons that can cause ...READ MORE

answered Mar 12, 2019 in AWS by Reema
2,024 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

bad permissions: ignore key: .ssh/my_private_key.pem Permission denied (publickey).

Hi@akhtar, In your error message it shows you ...READ MORE

answered Apr 28, 2020 in AWS by MD
• 95,460 points
10,965 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP