LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 02-08-2007, 03:34 AM   #1
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 431

Rep: Reputation: 30
SUID question


Hi there,
I have a question relating to SUID special permission.
I wanted to test its functionality and something doesn't work.

without SUID: script runs with the permissions of the user which starts the script
with SUID: the script runs with the permissions of the owner


I did the following test:

1. I have a directory named test (owned by root - 775 permissions) that contains 2 files: bar and foo.
2. bar is an executable file with only one command: rm foo
3. bar is owned by root (permission 4755) - SUID is set
4. foo is owned by root (permission 0400)
5. when a normal user runs bar, it should delete foo because it (bar) runs with the permissions of root (not the normal user which runs it). This happens only if the test directory has the appropiate rights for the normal user. Also if I add "chown user.user ." in doesn't work .
Under this conditions it seems that SUID doesn't work.

Please could any one clarify what I do wrong?
System in FC4.

Thanks
 
Old 02-08-2007, 04:52 AM   #2
MacMorning
LQ Newbie
 
Registered: Apr 2004
Distribution: Debian Sarge, OpenSUSE 10.2, FC6, RHEL4, RHEL5
Posts: 15

Rep: Reputation: 0
Afaik suid for shell scripts is disabled in most of linux distributions for security reasons.
Some workarounds are writing a short C wrapper or using sudo (recommended).
 
Old 02-08-2007, 05:20 AM   #3
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 431

Original Poster
Rep: Reputation: 30
So I understand that SUID has no effect on shell scripts only on C programs (or related). Right?
 
Old 02-08-2007, 05:28 AM   #4
MacMorning
LQ Newbie
 
Registered: Apr 2004
Distribution: Debian Sarge, OpenSUSE 10.2, FC6, RHEL4, RHEL5
Posts: 15

Rep: Reputation: 0
That's right.
I believe (didn't try myself though, just read about it) you can also use suid with a perl script for example.
 
  


Reply

Tags
suid


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suid? whishkah Linux - Software 5 09-07-2006 02:17 PM
suid/sgid question plan9 Linux - Security 1 07-08-2004 07:15 AM
SUID directory trophy Linux - Newbie 1 03-31-2004 09:29 PM
SUID file drops suid bit on append? c_coder Programming 1 03-12-2004 07:59 AM
Question: the concept of suid and sgid feetyouwell Linux - Software 4 02-03-2004 04:12 PM


All times are GMT -5. The time now is 12:02 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration