-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 15, 2020 in AWS by akhtar
• 38,170 points
820 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 15, 2020 by MD
• 95,060 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 your screenshot that ...READ MORE

answered May 3, 2018 in AWS by Cloud gunner
• 4,650 points
9,243 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
523 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,060 points
1,350 views