LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-20-2011, 08:35 AM   #1
Big-G
LQ Newbie
 
Registered: Oct 2011
Posts: 1

Rep: Reputation: Disabled
run a script


Hello members,

I am working at a new project and having a problem with it.
My problem is that i have someway to run a script(Ex: read 3 ints and print them) every time linux asks for the root password.
If anyone can tell me how to solve the problem, i would be grateful.
I also mention it won't be used for bad purpososes.

Ex:
Code:
user@home:~$ sudo apt-get update
insert 3 numbers: 2 3 4
the numbers are: 2 3 4
[sudo] password for user:
Best regards,
Big-G
 
Old 10-20-2011, 08:49 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

Could you tell us why you would want to do this? What exactly are you trying to accomplish with this? The more details you give us, the better we can help you.

Cheers,

Josh
 
Old 10-20-2011, 01:17 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
That is indeed an odd request.

But as a first suggestion, try taking a look at the sudo man page; and the -A option in particular.

To be accurate though, sudo does not ask for the root user password. Since the real purpose of sudo is to allow the administrator to specify certain commands that a user is allowed to run with root privileges, it asks for the password of that user.
 
  


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
My BASH script work perfect when i run it manualy, but not when it run in the crontab roqarg Linux - Newbie 30 05-06-2010 01:37 PM
I want to run script on the server from client machine in windows in a perl script vpradeep Linux - Newbie 2 09-01-2008 03:29 AM
MySQL Updates With Null When Perl Script Run From Shell Script ThisGuyIKnow Programming 6 08-12-2008 09:56 AM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM

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

All times are GMT -5. The time now is 12:19 PM.

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