Fedora permission issues

Hi, I was reading a book “The Linux Command Line” E. Shotts,
there is an example in page 109 , “Exercising Our Privileges”,
it is telling to have 2 users, bill and karen, bill has superuser privileges via sudo.
Make a group “music”, add there karen and bill,
and bill is making a directory.

# All commands are run by bill

$ sudo mkdir /usr/local/share/Music
$ ls -ld /usr/local/share/Music
drwxr-xr-x 2 root root ...

$ sudo chown :music /usr/local/share/Music

$ sudo chmod 775 /usr/local/share/Music

$ ls -ld /usr/local/share/Music
drwxrwxr-x 2 root music /usr/local/share/Music

$ > /usr/local/share/Music/test_file

and here is the problem that permission is denied to create a file in Music directory.

1 Like

Hello @pizzapablo666—welcome to the forum! Please take a minute to glance at the posts in #start-here if you haven’t already.

Can you edit the command list to mention what command is being run as what user (bill or karen)?

1 Like

I may have messed your commands while formatting them too—the last command maybe? Please fix that—sorry! :slightly_frowning_face:

All commands are used by bill

1 Like

Seems OK, apart from this last bit. How are you creating the new file? What is the command you are using, and what error does it give you?

" > path " this command is used for redirecting stdout stderr and also for creating files, for sure I have tried " touch command" and it is also says permission denied.
I have tried to make the file by sudo , and again permission denied, I can’t understand the problem, as I do exactly what is told in the book, and all outputs and permissions are correct, but I have issues when creating file in Music folder

1 Like

Okay I got the problem already, I have made a group ‘music’ in GUI, and it didn’t really worked, and bill user wasn’t in the group, that was the issue.

Ah, right, very weird.

I tried all the commands, and sudo touch .. works for me.

With respect to the groups, the user must log out and back in for the group information to apply. It’s already answered here, so I’ll just refer it for you to read:

1 Like

Even after you’ve correctly added them to the groups, you will need to log these users out and back in for these to take effect (as explained in the link)

1 Like