LinuxQuestions.org
Visit Jeremy's Blog.
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 10-26-2005, 06:14 AM   #1
madogy
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Rep: Reputation: 0
asking root password


how can i make a program installed by a normal user ask for the root password and then execute a command only root can execute.

example: i want my application to change the ip.
so i ask the user to give me the root password and i do my work
how can i do that? i want the main idea, it is not necesarry the whole code
thanks a lot

Last edited by madogy; 10-26-2005 at 06:15 AM.
 
Old 10-26-2005, 06:33 AM   #2
vmlinuz101
Member
 
Registered: Mar 2005
Location: Ireland
Distribution: LFS, SuSE, Debian, gentoo
Posts: 93

Rep: Reputation: 15
chown root <package>
 
Old 10-26-2005, 06:40 AM   #3
fvgestel
LQ Newbie
 
Registered: Oct 2005
Location: Netherlands
Posts: 21

Rep: Reputation: 15
In a shell script you can use the su command. eg :
su -c "<command to be executed as root>"
 
Old 10-28-2005, 03:43 AM   #4
madogy
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Original Poster
Rep: Reputation: 0
thanks a lot
 
  


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 could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
Booting into Single User on MDK 9 asks for root password instead of booting into root acadcworks Linux - General 6 01-10-2006 06:51 AM
root password a4syed Linux - General 7 10-01-2005 07:04 PM
Logged in as root, prompted for root password ta0kira Slackware 13 04-25-2005 01:29 AM
root password shanenin Linux - Security 13 09-25-2003 04:34 PM

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

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