Results 1 to 4 of 4
Hi.
I need to launch a bash file in Linux from an unprivileged user session, file that will run bash commands as root. But I do not want to create ...
- 03-03-2010 #1Just Joined!
- Join Date
- Apr 2009
- Posts
- 4
run bash commands as root.
Hi.
I need to launch a bash file in Linux from an unprivileged user session, file that will run bash commands as root. But I do not want to create an user with root privileges to do that.
Merci
Julia
- 03-03-2010 #2
You can use SUID.
SUID stands for set user id. When a SUID file executed, the process which runs it is granted access to system resources based on the user who owns the file and not the user who created the process. When a file is SUID root it allows a program/script to perform functions that regular users are not allowed to do themselves. Many buffer overflow exploits are the result of SUID programs.It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 03-03-2010 #3Just Joined!
- Join Date
- Apr 2009
- Posts
- 4
Thanks ,
It would be great if it worked, but
I've created with root a file named /test
then I've set the permissions to 107755
then I've added in the file the " iptables -L" line
changed the user to an unprivileged one
and tried to exec the "test" file.
the output was: iptables v1.3.5: can't initialize iptables table `filter': Permission denied (you must be root).
What am I doing wrong?
Julia
- 03-15-2010 #4
You could also try sudo - add your unprivilieged user the ability to run the iptables command or whatever you need run as root (a quick google should turn you up a decent sudo config guide) you can even have the entire script run as root using sudo
It basically involves configuring the /etc/sudoers file and enabling your user to run the relevant command needed then putting "sudo" before the command.
Sorry Im a bit vague, Im in the middle of configuring Redhat-DS, I'll write a better reply if this is something that interests you!


Reply With Quote