ls cannot open directory Permission denied

0 votes

Hi Guys,

I am trying to read the files inside /root folder. But it is showing me the below error.

[myuser@localhost root]$ ls
ls: cannot open directory '.': Permission denied

How can I solve this error?

Aug 13, 2020 in Linux Administration by akhtar
• 38,230 points
25,005 views

1 answer to this question.

0 votes

Hi@akhtar,

You got this error because your user does not have permission to read files inside /root folder. But you change the permission by using the below-given command.

$ chmod o+r /root/

I hope this will solve your error.

Hope it helps!

Enroll with Linux training online and learn in detail about Linux.

Thanks.

answered Aug 13, 2020 by MD
• 95,440 points
I tried to run the "chmod o+r /root/" cmd but it says "chmod: changing permissions of '/root/' : operation not permitted" so im a bit stuck at the moment

You have to run this command from your root account. Otherwise, you will get permission denied error.

Run the below command.

$ sudo chmod o+r /root/

Related Questions In Linux Administration

0 votes
1 answer

ssh :: Permission denied

Hey @Vinod,  Check if you're providing the correct ...READ MORE

answered Apr 2, 2019 in Linux Administration by Kalgi
• 52,360 points
2,462 views
–1 vote
1 answer

How to use help command for ls?

The help command is limited and it ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,210 points
2,993 views
–1 vote
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,210 points
2,092 views
0 votes
1 answer

How to give the read power of a folder in Linux system?

Hi@akhtar, You can use chmod command in your ...READ MORE

answered Aug 13, 2020 in Linux Administration by MD
• 95,440 points
662 views
0 votes
1 answer

How to remove write permission from a folder in Linux system?

Hi@akhtar, You can use chmod command to remove ...READ MORE

answered Aug 13, 2020 in Linux Administration by MD
• 95,440 points
2,991 views
0 votes
1 answer

How to change the owner of any folder in Linux system?

Hi@akhtar, Linux system has one command named chown. This ...READ MORE

answered Aug 14, 2020 in Linux Administration by MD
• 95,440 points
1,013 views
0 votes
1 answer

How to add user to a group in Linux system?

Hi@akhtar, In Linux, different users have different roles ...READ MORE

answered Aug 14, 2020 in Linux Administration by MD
• 95,440 points
519 views
0 votes
1 answer

-bash: cd: /root/: Permission denied

Hi@akhtar, You got this error because your user ...READ MORE

answered Aug 13, 2020 in Linux Administration by MD
• 95,440 points
43,563 views
+1 vote
2 answers

What does file permission 755 mean?

Hi, File permission 755 means that the directory ...READ MORE

answered Dec 9, 2020 in Linux Administration by MD
• 95,440 points
252,688 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