Group member cannot write even with write permission

The logged in user is a member of a group that has a write permission on a folder. But when this user is trying to write something, “permission is denied”.

The log below summarizes the question:

subv:/www/tracer/ whoami
frank
subv:/www/tracer/
subv:/www/tracer/ ls -ltr 
total 4
drwxrwxr-x 2 root tracer 4096 Jan 20 12:25 convert.tracer.com
subv:/www/tracer/ groups frank
frank : frank tracer
subv:/www/tracer/ > convert.tracer.com/test
-bash: convert.tracer.com/test: Permission denied
subv:/www/tracer/

Output of “ls -bail /www/tracer/convert.tracer.com/”:

subv:~/ ls -bail /www/tracer/convert.tracer.com/
total 8
38010883 drwxrwxr-x 2 root tracer 4096 Jan 20 12:25 .
38010882 drwxr-xr-x 3 root root    4096 Jan 20 12:25 ..
subv:~/

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Group membership is re-read on login. groups seem to report the groups you are in according to /etc/group and does not reflect membership of groups in the current session.

Use the command id -Gn to show the groups that you are currently an active member of. Solution: relogin to apply the group changes.

Method 2

What about the permissions of the directory where you have the file?

Are you able to edit the file, i.e. with vim, and save it?

Try to do something like

chmod g+w .

UPDATE

subv:~/ ls -bail /www/tracer/convert.tracer.com/
total 8
38010883 drwxrwxr-x 2 root tracer 4096 Jan 20 12:25 .
38010882 drwxr-xr-x 3 root root    4096 Jan 20 12:25 ..

It could there was an issue while creating the tracer directory, I see strange spaces between root and 4096 in the second line of your output.

I would try this as root:

cd /www/tracer/
chown root:root .
chown root:tracer convert.tracer.com

If it’s still ok, I’d check the group name in /etc/group, doing a

cat -v /etc/group

Checking that there are not non printable chars in root and tracer group

Finally if you still have the issue could be SELinux or an issue with the file system.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x