About
Community
News of the Temple
Community Bulletin Board
Chat
Art
Carnality
Entertainment
Science
Society
Technology
bbs | search | rss | faq | about | register
digg | del.icio.us | sphere | google

Go Back   Community > Technology > Everything *NIX

Everything *NIX This is a general forum about all forms of *nix. Post your ideas and thoughts on this wonderful OS family. Talk about your personal favorite flavor of *nix and why you think it's so much better than the others. Anything pertaining to *nix and *nix administration should be posted here.

Reply
 
Thread Tools Display Modes
  #11   Add deus-redux to your ignore list  
Old 2009-01-04, 17:52
deus-redux deus-redux is offline
Moderator
 
Great Britain Send a message via AIM to deus-redux Send a message via MSN to deus-redux
Smile Re: Running root commands without sudo

Quote:
Originally Posted by Dazzle View Post
The more I read about programming, the more I think I should learn C... it seems the be the fastest, most versatile language out there, albeit definitely not the simplest...


Slightly off topic, but in general (not just for this task): Do you think C (or maybe C++) would be more valuable than perl?
C is one of my favorite languages, and it's pretty much the backbone of *nix.

That said, Perl can also be very valuable.

I would really try and learn C now if you have the time. It's well worth it. Try and pick up Perl later if you get the chance. Once you know C, learning Perl should come easily.

Quote:
Originally Posted by Dazzle View Post
About the shell script: wouldn't you have to run the shell script as root in the first place? or just create it as root?
Try it on your system. Create a shell script that tries to do something only root can (create a file in root's home directory, for example).

su to root, chown the file to root:root. chmod a+x it, so all users can run it. chmod +s it, to set setuid. Return to your normal user, and execute.

setuid should mean the script runs with the permissions of root.

Now for me, this works fine for a binary executable, but not a shell script. I've looked into it, and the consensus seems to follow this:

http://rob.sun3.org/misc/setgid-and-...shell-scripts/

-deus-
__________________
My Blog (PHP, AJAX, etc)
Email Me

Last edited by deus-redux; 2009-01-04 at 18:02.
Reply With Quote
  #12   Add beatmeofficer to your ignore list  
Old 2009-01-05, 06:12
beatmeofficer beatmeofficer is offline
Regular
 
The First World
Default Re: Running root commands without sudo

Could this be solved by creating a new group, adding the users, and giving execute permission to members of the group?
Reply With Quote
  #13   Add coroner to your ignore list  
Old 2009-01-05, 18:06
coroner coroner is offline
Moderator
 
Sierra Vista. Arizona
Default Re: Running root commands without sudo

Quote:
Originally Posted by beatmeofficer View Post
Could this be solved by creating a new group, adding the users, and giving execute permission to members of the group?
You would think you could manipulate something using the wheel group, since wheel is in root's group. Unfortunately since Linux kernel does not let you use setuid or setgid on shell scripts as you would an ELF executable, then you simply cannot do this. What he should do is create a specialized group and put his users in that group, for example, autopsy and coroner on my laptop are in the "users" group. All I have to do is put the "users" group in the sudoers file, and require no password for any command, or I can specify which commands specifically with the full file path. No need to specify each user since sudoers allows specification by group and specific commands.

That is what he should do if using BASH.
Reply With Quote
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 Off
HTML code is Off
Forum Jump


All times are GMT. The time now is 14:41.


 

 

totse.com certificate signatures
 
 
About | Advertise | Art | Carnality | Community | Contact Us | Copyright Policy | Entertainment | FAQ
Link to totse.com | Science | Search | Society | Submissions | Technology
Hot Topics
Littering Is Awsome
Eradicating Feral Species
International Hanky Movement
Toilet paper down the toilet
Ecovillage project
The world is not going to flood!
Where is safe from climate change?
Global warming
 
Sponsored Links
 
Ads presented by the
AdBrite Ad Network

 

 
A Nightmare On Elm Street
A Nightmare On Elm Street Poster
Buy at AllPosters.com