LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-15-2005, 06:49 AM   #1
acidjuice
Member
 
Registered: Jan 2005
Location: a tiny spot on the iceberg
Distribution: Slackware 10.1 (dropline 2.10, kernel 2.6.11.6)
Posts: 320

Rep: Reputation: 30
run program as root / password prompt


dear all,

i have developed a small application that needs to be run as root.

now, if i set the 'execute' permissions to this file to root, if i run it as normal user i get an error, of course, since i do not have the permissions to do so.

what i'd like to do is that a box appears to enter the root password, so that then it's the root which is running the program. this is done in many apps such as package installers, updaters, desktop preferences setups, etc.

anyone knows how can i do this also for my tiny app?

thanks,

aj.

EDIT: i've seen that the files such as some package managers point to /usr/bin/consolehelper as link, but this starts console. or maybe SUDO? anyone?

Last edited by acidjuice; 03-15-2005 at 07:11 AM.
 
Old 03-15-2005, 08:00 AM   #2
p8080
LQ Newbie
 
Registered: Oct 2003
Location: Wolverhampton
Distribution: Suse
Posts: 26

Rep: Reputation: 15
you can use sudo. If you specify PASSWD in /etc/sudoers then the user will be prompted for the root password.
an entry in the /etc/sudoers such as:
%groupname ALL=PASSWD:ALL
should do it simply
regards
 
Old 03-15-2005, 08:08 AM   #3
acidjuice
Member
 
Registered: Jan 2005
Location: a tiny spot on the iceberg
Distribution: Slackware 10.1 (dropline 2.10, kernel 2.6.11.6)
Posts: 320

Original Poster
Rep: Reputation: 30
thank you p8080,

however i was looking for something a little more complex.

found this which is exactly what i was looking for, i guess this might be of some use to other forum members.

thank you,

aj.
 
Old 03-15-2005, 08:18 AM   #4
zeropash
Member
 
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
kdesu -u root -c command ?
 
Old 03-15-2005, 01:16 PM   #5
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
`gksu ~/hanoi.sh', for those who don't use KDE.
 
Old 03-15-2005, 01:51 PM   #6
elias5000
LQ Newbie
 
Registered: Sep 2004
Location: Berlin - Germany
Posts: 4

Rep: Reputation: 0
Quote:
Originally posted by zeropash
kdesu -u root -c command ?
what's kdesu? something like su for X?

i would use:

su - root -c <path>/<to>/<program>

or executing the prog with sudoers.
you can configure it so, that you can execute this certain prog as a certain user even without havong to give a password.
 
Old 03-15-2005, 10:33 PM   #7
zeropash
Member
 
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
kdesu comes with kde packge. it will ask for the password and after auth will run the program
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run a .desktop as root without password prompt subquantum Mandriva 3 07-31-2005 11:38 PM
My Knoppix 3.7 need root password when I run program AskMe Linux - Software 5 04-15-2005 05:35 AM
prompt for root password and passing to a program ludeKing Programming 4 08-23-2004 08:55 PM
Root Password Prompt Greyed Out !!! lionking_x Linux - Software 2 04-08-2004 10:05 AM
no password prompt after root login taboo Linux - General 1 12-22-2003 01:01 PM


All times are GMT -5. The time now is 07:26 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration