LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-16-2003, 01:21 PM   #1
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Diferrence between suid and executable by all?


What is the diferrence between making, say, shutdown executable by the non-root user by doing:
chmod u+s /sbin/shutdown
giving:
-r-sr-x--- root root shutdown?

and just making shutdown executable by all?

Thanks any help.
 
Old 10-16-2003, 01:46 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Setting the SUID bit forces the program to run with the privelages of the program owner. Making something executable by all will allow anybody to run the program; however, it may fail if the user does not have appropriate privelages.
 
Old 10-17-2003, 01:29 PM   #3
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215

Original Poster
Blog Entries: 2

Rep: Reputation: 49
Thanks.

You couldn't give an example of where the suided progam and the all-may-excuted program behave differently could you? Sorry if being dense.
 
Old 10-17-2003, 02:20 PM   #4
mr_manny
Member
 
Registered: Sep 2003
Distribution: RH7.3, RH9 w/fluxbox best thing since sliced bread
Posts: 34

Rep: Reputation: 15
I think "crontab" and "at" are good examples.

Due to underlying (system) authority issues w/these commands, they need to run w/setuid.

I think I'm right?

hope this helps,
manny


/home/manny> ll /usr/bin/* | grep rws
-rwsr-sr-x 1 root root 164 Jun 13 11:04 /usr/bin/aptlist
-rwsr-xr-x 1 root root 37528 Jan 17 2002 /usr/bin/at
-rwsr-sr-x 1 root root 31112 Apr 3 2002 /usr/bin/cdparanoia
-rwsr-sr-x 1 root root 593233 Feb 22 2002 /usr/bin/cdrdao
-rwsr-sr-x 1 root root 211146 Feb 28 2002 /usr/bin/cdrecord
-rwsr-xr-x 1 root root 34296 Feb 12 2003 /usr/bin/chage
-rws--x--x 1 root root 12072 Jun 24 2002 /usr/bin/chfn
-rws--x--x 1 root root 11496 Jun 24 2002 /usr/bin/chsh
-rwsr-xr-x 1 root root 21080 Apr 14 2002 /usr/bin/crontab
-rwsr-xr-x 1 root root 36100 Feb 12 2003 /usr/bin/gpasswd
-rwsr-xr-x 1 root root 39215 Aug 19 2002 /usr/bin/kv4lsetup
-rwsr-sr-x 1 root root 402726 Jul 16 2002 /usr/bin/lame
-rwsr-xr-x 1 root root 19931 May 13 03:06 /usr/bin/lppasswd
-rwsr-sr-x 1 root root 404480 Feb 28 2002 /usr/bin/mkisofs
-rwsr-sr-x 1 root root 137084 Jul 16 2001 /usr/bin/ncpmount
-rwsr-sr-x 1 root root 117628 Jul 16 2001 /usr/bin/ncpumount
-rws--x--x 1 root root 4764 Jun 24 2002 /usr/bin/newgrp
-rwsr-xr-x 1 root root 149454 Jul 16 2001 /usr/bin/nwsfind
-rwsr-xr-x 1 root root 14588 Jul 24 2001 /usr/bin/rcp
-rwsr-xr-x 1 root root 10940 Jul 24 2001 /usr/bin/rlogin
-rwsr-xr-x 1 root root 7932 Jul 24 2001 /usr/bin/rsh
-rwsr-sr-x 1 root root 4816 Jul 16 2001 /usr/bin/slist
-rws--x--x 2 root root 808526 Aug 18 13:12 /usr/bin/sperl5.6.1
-rws--x--x 2 root root 808526 Aug 18 13:12 /usr/bin/suidperl
 
Old 10-17-2003, 04:39 PM   #5
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Quote:
Originally posted by lugoteehalt
You couldn't give an example of where the suided progam and the all-may-excuted program behave differently could you? Sorry if being dense.
SUID example: passwd -without the SUID bit, users would not be able to change their password because /etc/shadow is accessible only by root.

Executable by all example: more -any user can run it but it doesn't always let you view the file if you don't have permission (ie more /etc/shadow as a nonroot user)
 
Old 10-18-2003, 04:22 AM   #6
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215

Original Poster
Blog Entries: 2

Rep: Reputation: 49
Right - I get it. You've got to call that a success. Thanks.
 
  


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
suid bit on an executable is ignored during boot process. rob_of_ownsboro Linux - General 3 11-22-2005 12:34 PM
Running a Java executable class from another executable class LUB997 Programming 22 07-24-2005 04:57 AM
SUID directory trophy Linux - Newbie 1 03-31-2004 09:29 PM
SUID C function untwisted Programming 10 03-22-2004 07:19 PM
SUID file drops suid bit on append? c_coder Programming 1 03-12-2004 07:59 AM

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

All times are GMT -5. The time now is 07:40 AM.

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