1

I have changed my windows machine to Artix linux. And I had bunch of music in the windows so I just kept them in drive and moved them over to new Artix installation. At first, the permissions of files and directories was insane, everyone had execute permissions for all directories and files(because they were coming from windows). So I changed them with runnign chmod -x {dirs and files}. Because I have done all the installation and the moving the folder over as root, obviously, the owner of the files was root. So I changed them with chown -R murad rammstein (all my music is in that folder). But when I try to cd rammstein I get cd rammstein/ Permission denied. So what is the problem?

The permissions and owner of the folder

drw-r--r-- 9 murad wheel 4096 Jan 31 15:54 rammstein

All the other folder and files are the same, for example the directories inside of rammstein are

drw-r--r-- 2 murad wheel 4096 Jan 31 15:53 rammstein-herzeleid-1995
<and 5 different folders with the same perms/owner>

And the songs' permission inside of an album folder

-rw-r--r-- 1 murad wheel  9688925 Jan 31 15:53 rammstein-asche-zu-asche.mp3

From here it's obvious that I can, at least, view those folders and files. But I'm not sure a simple cd gives Permission denied error.

  • 3
    The dir should be executable too if you want to cd into it. chmod +x rammstein. –  Jan 31 '21 at 19:31
  • For directories, the x permission grants permission to search the directory. It's necessary. find . -type d -print0 | xargs -0 --no-run-if-empty chmod o+x should fix. – waltinator Jan 31 '21 at 19:33
  • Oh man I am an idiot. Thank you so much. – spitfire Jan 31 '21 at 19:44
  • No, you're not. Happened to all of us at some point (sometimes still does, just hopefully not as often ...). – AdminBee Feb 01 '21 at 10:33

1 Answers1

1

via comments of @Uncle Billy and @waltinator:

Directories should be executable in order to search it.

So change the permissions of relevant directories with chmod +x <folder>