What's the difference between rwxrwSr-x and rwxrwsr-x?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers What's the difference between rwxrwSr-x and rwxrwsr-x?
# 1  
Old 09-02-2008
What's the difference between rwxrwSr-x and rwxrwsr-x?

The other question is, if ls shows:
Quote:
drwxr-sr-x 2 usr1 group1 1024 Sep 2 04:00 script1
Does it mean any users (not just in group1) can run the script like usr1?
So that's the difference between drwxr-sr-x and drwxr-xr-x?

Thanks!
# 2  
Old 09-02-2008
Read Perderabo's tutorial Unix File Permissions, the section The Setuid and the Setgid Bits explains the difference between s and S. You could also read the Useless Bit Combination? section.
# 3  
Old 09-03-2008
The article did NOT answer my question

I already read that article before I post my question, but still got confused. The article says, "if the suid bit is set, but the owner execute bit is off, ls will display a capital S in the case."

But as I understand, the purpose to set suid is: although the file is owned by root, other user can run it. If the file's execute bit is off, what's the purpose to set suid?!

I was hoping to get an answer from another expert. If you understand my question, just spend a few minutes to answer it. Don't assume people did not do their basic homework before they post their questions. It's frustrating to see a post sank without getting a contructive answer.

Also, all suid/guid examples I saw are using root as the owner. Now I'm seeing a normal username has suid/guid bits set. Does it work similarly? i.e. If the file is owned by user1, with a suid bit set, then any other users can run the file?
For guid bit set, if the file is owned by group1, then any other groups can run the file?
# 4  
Old 09-03-2008
I spent quite a bit of time on that article and I'm dismayed that you dismiss it with a comment like "The article did NOT answer my question". When you phrase a question like "If the file's execute bit is off", I have to think that that a rereading of my article might be useful. There are three execute bits, not one, and you do not have a case where all three are off. The section "Useless Bit Combination" discusses your question in some depth and none of the files in that section are owned by root. Suid works fine with non-root users, but none of the examples in your questions had anything to do suid. Your examples are sgid, not suid.
# 5  
Old 09-03-2008
Perderabo, sorry I didn't realize you have multiple posts regarding this question. Thanks for the in-depth explanation in your posts and pointing out my errors. I have a much better idea about suid/sgid now.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to calculate difference of split and sum the difference

In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13. I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies

2. Programming

what is the main difference between difference between using nonatomic lseek and O_APPEND

I think both write at the end of the file ...... but is there a sharp difference between those 2 instruction ..... thank you this is my 3rd question today forgive me :D (1 Reply)
Discussion started by: fwrlfo
1 Replies

3. Shell Programming and Scripting

What's the difference between $* and $@ ?

What's the difference between $* and $@? And I read that the $* has security problems, why? (6 Replies)
Discussion started by: Henryyy
6 Replies

4. Shell Programming and Scripting

difference between > and 2>

Hi could you please tell me, what is the difference between this two urgently (2 Replies)
Discussion started by: lnviyyapu
2 Replies

5. Shell Programming and Scripting

Difference between 1,$ and /g

just wondering what the difference is between 1,$ and /g when doing a substitution in vi. doesn't seem to be much difference from what i can see. (2 Replies)
Discussion started by: bigubosu
2 Replies

6. Programming

while and if, what is the difference?

Hi, I am learning C++ and I have the following code: //Tokenizing program: pointer version. #include <iostream> #include <cstdio> using namespace std; int main() { char str; char token; char *p, *q; cout << "Enter a sentence: "; gets(str); p=str; //read a... (4 Replies)
Discussion started by: faizlo
4 Replies

7. Shell Programming and Scripting

does someone see the difference

this works (session is set in -x) @@ecar0o:/html/dbs/public/cgi-bin> ssh ecar0o.bc -l oracle ssh cas_a "find /casa/dbcrea/`echo casa | cut -c 1-3`/rel55595 -type f ! -name '*.dbf' -exec ls -l {} \\\\\;" + cut -c 1-3 + echo casa + ssh ecar0o.bc -l oracle ssh cas_a find... (1 Reply)
Discussion started by: plelie2
1 Replies

8. UNIX for Advanced & Expert Users

Difference between @# and @*

hi Can any one explain me difference between @# and @* with the help of examples? Thanks (3 Replies)
Discussion started by: rochitsharma
3 Replies

9. UNIX for Dummies Questions & Answers

difference between == and =

This is probably a stupid question to ask. But could somebody help me clearly distinguish the difference between these two operators in unix '==' and '='? (7 Replies)
Discussion started by: Vikas Sood
7 Replies

10. Linux

what is the difference between -h and -H ?

samba:/home/backup # df -h /home/ Filesystem Size Used Avail Use% Mounted on /dev/sdb2 34G 8.6G 26G 26% /home samba:/home/backup # df -H /home/ Filesystem Size Used Avail Use% Mounted on /dev/sdb2 37GB 9.2GB 28GB 26% /home what... (2 Replies)
Discussion started by: cw1972
2 Replies
Login or Register to Ask a Question