Linux file folder Permission issue (Owned by group)

0

I have created three users: - media, media1 and media2 I have added these users to group called Media.

than using chgrp i have modified group on two existing folders "Archive" and "Media".

Media group should have read/write/modify access to these two directories and sub directories.

at moment all directories are owned by Media group.

Directory is as follow :

# ls -ld
drwxrwsr-x    2 media1 Media 4096 Jul 26 12:22 Media/

but when user media2 tries to remove this directory or file or tries to create new file/folder under Archive or Media folder it throws error permission denied.

what could be wrong?

Usman Masood

Posted 2013-07-26T12:24:00.340

Reputation: 135

Answers

1

You are missing the "write" permission for the group.

chmod g+w Media/
chmod g+w Archive/

Should solve your problem.

For further information, see This tutorial

mveroone

Posted 2013-07-26T12:24:00.340

Reputation: 1 752

i have deleted the old one. because it was closed (duplicate) and added detailed info into this. – Usman Masood – 2013-07-26T12:30:13.557

Then that's okay I guess. Happy to have helped you. – mveroone – 2013-07-26T12:33:51.900

drwxrwsr-x 2 media1 Media 4096 Jul 26 08:12 but user media2 error: Unable to create folder Permission denied. – Usman Masood – 2013-07-26T12:41:00.297

@UsmanMasood I guess media2 is correctly in Media group ? (does groups tell so ?) – Levans – 2013-07-26T12:46:46.683

media1 : media-daemon Media media2 : Share Media

both users belong to Media group. result of groups command. – Usman Masood – 2013-07-26T12:50:49.590

I have tried to setup the exact same setup on my computer and i am able to create/delete files under Media/ owned by media1 user and mediagroup, mode rwxrwsr-x with media2 user. This work both when users have media as primary or additional group – mveroone – 2013-07-26T12:55:36.727

my current directory permissions are: drwxrwsr-x 2 media1 Media 4096 Jul 26 08:12 Any difference in that? – Usman Masood – 2013-07-26T12:56:50.103

Mine is absolutely identical. : drwxrwsr-x 2 media1 Media 4096 Jul 26 14:55 Media ///
user media1 : uid=3034(media1) gid=100(users) groups=100(users),3034(Media) ////
user media2 : uid=3035(media2) gid=100(users) groups=100(users),3034(Media)
– mveroone – 2013-07-26T13:05:04.367

Can you update your question with traces from what your are trying that fails ? – mveroone – 2013-07-26T13:10:41.990

not sure, if that resolved it. a Chown to group did the trick. anyhow thanks for help. – Usman Masood – 2013-07-26T22:02:21.590