LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-09-2004, 01:36 PM   #1
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
Question How to view set-user-ID and set-group-ID


Hi guys

I have question. How can I view files with set-user-ID and set-group-ID. For example when i do this:

ls -l
-rw-r--r-- 1 102 adm 1660656 Jan 27 2003 file_name

but this does not show me what set-user-ID or set-group-ID or sticky bit for this particular file or any files for that matter. It only gives me permissions for it. How can I view set-user-ID or set-group-ID or sticky bit ?

I have been reading man on ls and chmod and couldnt find anything in man pages. Searched online but was unsuccessful. Any help would be appreciated.
 
Old 01-09-2004, 02:45 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
but this does not show me what set-user-ID or set-group-ID or sticky bit for this particular file or any files for that matter. It only gives me permissions for it.
Well, this might be because there are none?
Usually you'll only see SUID/SGID on executalbes,
in the first place ...
Have a look at

ls -l /usr/sbin

You'll probably find a few that look like
Code:
-r-xr-sr-x    1 root     smmsp      519864 Jun  5  2002 sendmail
-r-sr-xr-x    1 root     root        15848 Feb 21  2003 unix_chkpwd
Note the s instead of the x? :)


Cheers,
Tink
 
Old 01-09-2004, 08:40 PM   #3
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
So what does that mean "s" instead of an "x" ? whats "s" stand for ? and does it only show up in executable files?
 
Old 01-09-2004, 09:13 PM   #4
fr0zen
Member
 
Registered: Nov 2003
Location: 127.0.0.1
Distribution: xubuntu
Posts: 217

Rep: Reputation: 30
's' implies the set sticky-bit. The location of the 's' determines whether it sets the UID or GID.

It only applies to files that have execution capabilities. This is not limited to binary files, but scripts as well.
 
Old 01-09-2004, 09:23 PM   #5
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
Cool thanks for info... Another question what is the difference between 4700 and 700 permissions ?
 
Old 01-09-2004, 11:44 PM   #6
fr0zen
Member
 
Registered: Nov 2003
Location: 127.0.0.1
Distribution: xubuntu
Posts: 217

Rep: Reputation: 30
The difference is that 4700 sets the stick-bit for SUID, whereas 700 merely enables read, write and execute for just the owner of the file.

4700 is a rather pointless combination, as it defeats the purpose of the SUID sticky-bit. If you were to chmod something to 4700, only the owner of the file would be able to execute it. Then, the program would be SUID to that user. Since the prerequisite for execution (or read and write even) is that you be the owner of the file, seems like you're doing more work than you really need.
 
Old 01-10-2004, 12:49 PM   #7
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
Thanks for info ... more questions

How about 4750 vs 750 .... What is the difference between this?
 
Old 01-10-2004, 01:44 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Same as above. Just that in this case the owner can
edit it, too, while the the group can only read and
execute, and other can do diddly-squat.


Try
man 2 chmod
, this is getting tiring...


Cheers,
Tink
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set the permissions for a user Group? Akhran Linux - Newbie 6 11-14-2005 07:55 AM
strange group and user set to "573" in linux-2.4.27 tree structure xround Linux - General 2 10-12-2004 11:09 AM
Unable to view user/group console? bottomsup6 Linux - Software 1 07-28-2004 11:59 AM
How to set the default group for a new user in SuSE. jschiwal Linux - Distributions 1 07-24-2004 11:25 PM
[alert] (22) Invalid argument : setgid : unable to set group id to Group 4294967295 Niraj Linux - Networking 1 12-13-2001 06:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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