Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 03-24-2008, 01:59 PM   #1
Registered: Nov 2005
Posts: 90

Rep: Reputation: 15
bash setuid child proccess


in a script I adjust some firewall settings (via iptables calls). I want that users can run the script so I have tried to set the SID bit but the iptables calls throw an error saying permission denied. So my question: Is there a possibility that the iptables calls inherit the setuid?

PS: I know that I could use sudo for such a task ;-)

Old 03-25-2008, 07:46 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Well, iptables itself needs root access. Setting your script that calls iptables with setuid isn't going to cut it. I'd say go with the sudo option.
Old 03-25-2008, 01:16 PM   #3
Registered: Nov 2005
Posts: 90

Original Poster
Rep: Reputation: 15

thanks, this is what I have done now (sudo). But I was astonished that setuid does not work, is this specific for iptables or a general rule?

Old 03-25-2008, 01:45 PM   #4
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
I think it is not allowed to use suid/sgid with scripts (only binaries).

See this.

That is to say, you can set it, but your script will not get suid privileges.
Old 03-25-2008, 05:24 PM   #5
Registered: Nov 2005
Posts: 90

Original Poster
Rep: Reputation: 15

thanks! I will stay using sudo.



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash child process in foreground while parent dies kborgnis Programming 3 11-09-2007 06:50 AM
Running commands from array in a child bash script bengoavs Programming 2 10-26-2007 02:16 PM
Setting up cron to proccess a Bash Script to run every 15 minutes jamtech Programming 3 07-30-2007 03:32 PM
Bash script to email setuid root files deoren Member Success Stories 1 01-30-2005 09:56 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:36 AM.

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