Stefan Oostwouder
Stefan Oostwouder

Reputation: 25

centos file creation won't work even tho 775

we are having a problem (taht i have reproduced below on smaller scale), where we cant write a file, when i think we should

# ls -ld testdir
drwxrwxr-x 2 user1 root 4096 Nov 19 12:13 testdir
# groups user1
user1 : user1 foo
#groups foo
foo: foo user1

but when i log into the foo user and from testdir start the editor

[foo@myhost testdir]$ nano tempfile

and try to save it i get [ error writing tempfile: permission denied ]
even tho i have
- set the parent folder to 775
- added the user to the group that owns the folder
- relogged the foo and user1 user

(and if i change the folder to 777 it does work, but i really dont want that on the webserver (it leaves a backdoor open for hackers to replace files)

Upvotes: 0

Views: 177

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 81052

The group on testdir is root not user1.

Run chgrp user1 testdir and see if that fixes the problem.

Upvotes: 1

Related Questions