Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.