Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Permissions surviving chmod 0000?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
BioSLuDge
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2004
Posts: 99
Location: Utah

PostPosted: Sun Jun 03, 2007 8:29 pm    Post subject: Permissions surviving chmod 0000? Reply with quote

I have a folder that I was trying to restrict permissions on but I can't seam to do it.

I was trying to lock down access on a directory to just user/group but found that I was not able to with just chmod 770. So I tried to chmod 0000 the dir (that should totally make it unusable) but it does not.
These are the permissions that are still associated with the file after running ls -al after the chmod 0000

Code:
d--S--S---


I should also note that this the root dir of a mounted fs.

Thanks in advanced for your help with what I'm sure is just a stupid little permissions catch that I'm not aware of.
-BioSLuDge
Back to top
View user's profile Send private message
caslca
Tux's lil' helper
Tux's lil' helper


Joined: 24 Aug 2003
Posts: 85

PostPosted: Sun Jun 03, 2007 9:31 pm    Post subject: Reply with quote

Code:
lappy ~ # cd /
lappy / # ls
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  sbin  sys  tmp  usr  var
lappy / # mkdir b
lappy / # chmod 0000 b
lappy / # ls -l
total 23
d---------  2 root root   48 Jun  3 14:28 b


What file system are you using? The above test was on reiser3
also, what does "mount" say?
Back to top
View user's profile Send private message
dleverton
Guru
Guru


Joined: 28 Aug 2006
Posts: 517

PostPosted: Sun Jun 03, 2007 9:35 pm    Post subject: Reply with quote

coreutils info page wrote:
On most systems, if a directory's set-group-ID bit is set, newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set-group-ID bit of the parent directory. On a few systems, a directory's set-user-ID bit has a similar effect on the ownership of new subfiles and the set-user-ID
bits of new subdirectories. These mechanisms let users share files more easily, by lessening the need to use `chmod' or `chown' to share new files.

These convenience mechanisms rely on the set-user-ID and set-group-ID bits of directories. If commands like `chmod' and `mkdir' routinely cleared these bits on directories, the mechanisms would be less convenient and it would be harder to share files. Therefore, a command like `chmod' does not affect the set-user-ID or set-group-ID bits of a directory unless the user specifically mentions them in a symbolic mode, or sets them in a numeric mode.


So,
Code:
chmod u-s,g-s ...
should do it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum