Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

I've run into a bizarre issue.

I'm working on a project with a friend. I created a team group and added us both to it. I gave the directory group write permissions. I even set the sticky bit to make sure that the group setting persists. My friend is able to create files, but I am not. I get an error:

joe@server:/opt/project$ touch file
touch: cannot touch 'file': Permission denied
joe@server:/opt/project$ echo "test" > file
bash: file: Permission denied

Here are the permissions:

joe@server:/opt/project$ ls -al
total 20
drwxrwsr-x 4 root team 4096 2011-02-12 20:31 .
drwxr-xr-x 6 root root 4096 2011-02-12 17:10 ..

And I am sure I am in the group:

joe@server:/opt/project$ grep ^team /etc/group
team:x:1003:joe,friend

Any ideas?

asked 15 Feb '11, 03:38

Joehillen's gravatar image

Joehillen
1462512
accept rate: 40%

closed 04 Dec '13, 09:45

rfelsburg's gravatar image

rfelsburg ♦
6061618




What if you try and create the file with sudo?


cd /opt/project
sudo touch file

Does it work then?

Also, Do you and your friend have the same UIDs? (example - you both say have a UID of 1001)

Are you both SSHing into this system?

Is it over a LAN with Samba?

link

answered 16 Feb '11, 00:02

Ron's gravatar image

Ron ♦
9361718
accept rate: 13%

Well, thread seems dead, but another problem that happens is you add yourself to a group and it does not take effect until you logout and back in.

link

answered 31 Oct '12, 14:56

ranton's gravatar image

ranton
213
accept rate: 0%

Also can we have an lsattr /opt/

link

answered 04 Apr '11, 05:05

adymcc's gravatar image

adymcc
1
accept rate: 0%

Do you have selinux turned on? If so can you see if you are receiving avc denied errors in the auditd log?

Please post the run of the following two commands as well.

/usr/sbin/sestatus cat /etc/sysconfig/selinux

link

answered 08 Apr '11, 13:32

rfelsburg's gravatar image

rfelsburg ♦
6061618
accept rate: 25%

After no response to my queries 2 months ago, I doubt we'll get any response at all on this question. Someone mark it closed. We get a lot of these "hit and runs" which is where basically someone drops a question into the queue and then never returns for an answer.... or they wait a very short time and then give up. Having tons of "hit and runs" like this really brings this place down because it causes a lot of extraneous junk for the readers to sort through. We need a janitor to /kill these.

link

answered 08 Apr '11, 17:14

Ron's gravatar image

Ron ♦
9361718
accept rate: 13%

Same thing here, just wasn't paying attention to the date.

-Rob

(09 Apr '11, 13:22) rfelsburg ♦

might sound silly but check the write permissions are available on the file for group.

link

answered 02 Oct '12, 11:55

zoolium's gravatar image

zoolium
111
accept rate: 0%

you must see the permission on the project directory , i think you have not a write permission on it

link

answered 04 Dec '13, 04:29

Eslam%20Baset's gravatar image

Eslam Baset
111
accept rate: 0%

Yes use below command it will help you. Sudo means Super user do like one you have Run As Administrator in windows.

sudo touch file
link

answered 22 Jan '14, 11:32

Gurupal%20Singh's gravatar image

Gurupal Singh
111
accept rate: 0%

Just so you know the you have not set the "sticky" bit, rather you have set the "suid". This means you are both running as root. http://docs.oracle.com/cd/E19683-01/816-4883/secfile-69/index.html

link

answered 23 Jan '14, 04:49

zoolium's gravatar image

zoolium
111
accept rate: 0%

Technically, you're correct. He didn't set the sticky bit, but most newer users don't realize that the sticky bit is an actual change, they think it just means one of the special bits. SUID, SGID,etc.

Howeverm he didn't set suid, he set sgid, which means any file/directory under that will be created with the same group. He was correct, if you look at the directory perms you can see that the sticky bit is set in the group execute place.

drwxrwsr-x 4 root team 4096 2011-02-12 20:31 .

U G O d rwx rws r-x

If he had set the suid bit, it would have been

U G O d rws rwx r-x

Also, this thread is dead and answered :-) IT was 2 years ago, if it makes you feel better, it seems like everyone manages to find this question and keep answering it. Lol, Heck, I even did the same thing.

(23 Jan '14, 16:04) rfelsburg ♦

Yeah, I didn't spot this thread had been kicked into touch, I was only responding to an email alert "Gurupal Singh" had triggered yesterday. Naturally, I meant setgid not setuid ....my bad ;-)).

(24 Jan '14, 06:12) zoolium
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×12

Asked: 15 Feb '11, 03:38

Seen: 15,002 times

Last updated: 24 Jan '14, 06:12

powered by OSQA