LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 04-27-2007, 08:19 AM   #1
mson
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Rep: Reputation: 0
how to run as root


hey guyz,

i want to add users by running a java-programm (java is not running as root).
my programm should run a script as wwwrun user.

the script must get root-priv and execute the lines.
how can i do this ???

greez
 
Old 04-27-2007, 09:16 AM   #2
hightechterror
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Rep: Reputation: 0
Please include what distribution you are using, and the syntax of the command you are typing.

HTT
 
Old 04-27-2007, 09:35 AM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
http://tldp.org/LDP/intro-linux/html/sect_04_01.html

You want to read about SUID.
 
Old 04-27-2007, 11:02 AM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
i want to add users by running a java-programm (java is not running as root).
my programm should run a script as wwwrun user.

the script must get root-priv and execute the lines.
how can i do this ???
Looks like he's asking for help writing a hack-script to me. (wwwrun and get root-priv)
 
Old 04-27-2007, 11:25 AM   #5
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
or maybe sudo

check sudo help on web.
It must be pretty easy to grand a user root privilege.

Ex:

The line

$##
wwwrun ALL=(root) scriptname
##

This should be put in /etc/sudoers file and then the user can run the command as root like thus

$ sudo scriptname
 
Old 04-27-2007, 11:38 AM   #6
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
This should be put in /etc/sudoers file and then the user can run the command as root like thus
If you put that in the sudoers file, you might as well just set the root password to null or post it on MOTD.
 
Old 04-28-2007, 05:31 AM   #7
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
i dont think so.

by putting the above line the user will be able to run the command as 'root' user.
and he doeant have to know the root password too.
he just has to give his password while running the script.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't run as root phantom_cyph Linspire/Freespire 6 04-28-2007 06:05 PM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM
how do I run from root repairshop Linux - Newbie 6 02-01-2007 09:18 AM
I have to ssh -l root to run root processes!? paul.nel Red Hat 3 11-15-2004 11:55 AM
LimeWire installed as root, can't run if not root sulzla Linux - Newbie 1 07-01-2003 07:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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