LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2004, 03:38 PM   #1
chichibabin
Member
 
Registered: Sep 2003
Posts: 63

Rep: Reputation: 15
Root access in a script


Hi
I would like to write a script that can be executed by a normal user which contains commands that require root privileges. There must be some way of executing the su command from within the script followed by the root password, execute the desired commands and then log back to the normal user?
Cheers
Sat
 
Old 07-27-2004, 03:46 PM   #2
dxdad
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 75

Rep: Reputation: 15
Is "sudo" not the thing to use for this?
 
Old 07-27-2004, 03:47 PM   #3
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
You definitely don't want to put the root password in your script. Then any user would be able to get root access just by looking at the script file.
 
Old 07-27-2004, 04:01 PM   #4
dxdad
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 75

Rep: Reputation: 15
Depending on what it was you wanted to run as root you could set the file as SUID
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get root access?? anjum Ubuntu 7 08-09-2005 10:47 AM
root access pazvant Linux - Security 4 03-12-2005 09:41 AM
need help with root access gue_andy Linux - Software 1 02-07-2005 11:47 AM
Lauching script at shell startup without having root access. begin55676 Linux - Newbie 2 12-10-2004 03:42 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:26 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