Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 01-18-2006, 09:38 AM   #1
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
suid on directory - doesn't, sgid ok?

Strange problem this...
Fiddling with permissions, want to set user and group in a directory by sticky bits. Setting group works - but not user?

It should be like this (taking from samba.doc):
$ chmod 6775 /foodbar
$ ls -al /foodbar/..
You should see:
drwsrwsr-x  2 jack  engr    48 2003-02-04 09:55 foodbar
Now type:
$ su - jill
$ cd /foodbar
$ touch Afile
$ ls -al
You should see that the file Afile created by Jill will have ownership and permissions of Jack, as follows:
-rw-r--r--  1 jack  engr     0 2003-02-04 09:57 Afile
So I did the same:
ls -l /shares/
drwsrwsrwx 2 saras larare 4096 18 jan 16.16 saras
As user pingu:
# cd /shares/saras
# touch afile
# ls -l
-rw-rw-r-- 1 pingu larare 0 18 jan 16.20 Afile

Why the he... isn't user saras???

Oh, I forgot: I'm running Fedora Core4

Last edited by pingu; 01-18-2006 at 09:41 AM.
Old 01-18-2006, 04:04 PM   #2
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
I would've thought it should've worked too, but it doesnt:
info chmod:

set the process's effective user ID to that of the file upon
execution (called the "setuid bit"). No effect on directories.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eliminating SUID & SGID? ridertech Linux - Security 4 07-08-2004 05:58 PM
suid/sgid question plan9 Linux - Security 1 07-08-2004 07:15 AM
Question: the concept of suid and sgid feetyouwell Linux - Software 4 02-03-2004 04:12 PM
shell variables &suid&sgid alaios Linux - General 6 05-23-2003 04:03 PM
SGID and SUID on Directories mikeyt_333 Linux - General 1 03-26-2002 02:41 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration