Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-18-2006, 04:33 AM   #1
Registered: Apr 2006
Location: Singapore
Distribution: RHEL4,FC4,FC5
Posts: 89

Rep: Reputation: 15
chmod +s

on the man page, it said "set user or group ID on execution (s)"

what does it mean? when I do a ls -l , i notice there is a "s".

I did some testing with (chmod +s) or without (chmod -s), i dont see any different when creating directory or file. the directory or file will still belong to the user:group who created it.


Last edited by binary_0011; 04-18-2006 at 04:35 AM.
Old 04-18-2006, 05:04 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
If someone else runs the file, they will run the file as the user/group who created it.

It should only be used on a small number of programs such as "passwd" which absolutely require the command to run as root. The "passwd" command edits the /etc/passwd file and so needs to be root.

Using the find command to locate suid and guid files is a common practice to locate candidate programs to uninstall.
This is especially true for dedicated servers.
Old 04-18-2006, 05:55 AM   #3
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Using chmod +s on (executable) files will do as kschiwal said.
Using it on a directory is slightly different. "Executing" a directory (x permission) means the possibility
to access anything in the directory (either file or subdir). This is different from read (r) permission on a directory, which allows you to read the names of the files/subdirectories (ie the directory contents).

Using chmod +s on a directory, changes the user/group as which you "execute" the directory. This implies that, whenever a new file or subdir is created, it will "inherit" the group ownership of the parent directory if the "setGID" bit is set. Inheriting the owner is not possible. Ownership of new files/subdirs always belongs to the user who created it.


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
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 05:23 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 09:53 PM
Chmod nrmx Linux - Software 1 12-24-2004 12:43 PM
chmod hokagi_ninja Linux - Newbie 4 11-16-2004 12:02 AM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 06:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:04 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