Unix/Linux Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Sudo command problem

UNIX for Advanced & Expert Users


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-12-2009   -   Original Discussion by mindtee_abhi
mindtee_abhi's Unix or Linux Image
mindtee_abhi mindtee_abhi is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 15 December 2009, 12:31 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Sudo command problem

Hi All,

I am tring to redirect mails comming to my user id to a script. In other word trigger a script when a mail comes to my user id.

Actually , Admin team has done all this to me previously. in my script i am doing like
/usr/local/bin/sudo -u parbrxs /export/home/parbrxs/bin/parbrxs.sh

it was working fine and it was able to trigger parbrxs.sh.
Now problem is, i want to change my script name from parbrxs.sh to abhishek_test.sh.

But this is giving error,

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
Sorry, try again.
sudo: 3 incorrect password attempts


can any one please tell me what is the exact problem? Is there any settings i am missing?
Sponsored Links
    #2  
Old Unix and Linux 03-12-2009   -   Original Discussion by mindtee_abhi
pludi's Unix or Linux Image
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,521
Thanks: 38
Thanked 335 Times in 308 Posts
The admins probably created a NOPASSWD rule for that specific command (path and all) in the sudoers file. If you change it, that rule no longer catches, and so the password prompt is displayed.
Sponsored Links
    #3  
Old Unix and Linux 03-12-2009   -   Original Discussion by mindtee_abhi
mindtee_abhi's Unix or Linux Image
mindtee_abhi mindtee_abhi is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 15 December 2009, 12:31 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks pludi .

But these is no sudoer file in /etc folder. Is there any other path or file where these setting can be done.
    #4  
Old Unix and Linux 03-12-2009   -   Original Discussion by mindtee_abhi
pludi's Unix or Linux Image
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,521
Thanks: 38
Thanked 335 Times in 308 Posts
visudo will allow the admins to edit the sudoers file (wherever it may sit). But it's not possible for a user to change or even view that file (although that last statement is not always true)
Sponsored Links
    #5  
Old Unix and Linux 03-17-2009   -   Original Discussion by mindtee_abhi
mindtee_abhi's Unix or Linux Image
mindtee_abhi mindtee_abhi is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 15 December 2009, 12:31 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks paludi,
Ad i told , My main requirement is to trigger a script "abhishektest.sh "whenever a mail come to a user say "abhishek" in my unix server. I dont have root permission.
So, for doing this
1) in /etc/mail/aliases : i need to ask admin to configure so that mail will route through a script.
e.g.
abhishek : "|/export/home/abhishek/bin/wr_test.sh
2) in wr_test file : i need to put this line, as i have to switch user from root to abhishek.
/usr/local/bin/sudo -u abhsihek /export/home/abhishek/bin/abhishektest.sh
and ask admin to set NOPASSWD rule for this command.

Please let me know if anything wrong in this procedure.or anything else need to be added.

Last edited by mindtee_abhi; 03-17-2009 at 05:34 AM..
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sudo command with password chebarbudo Shell Programming and Scripting 1 12-29-2008 08:13 AM
sudo command remotely pvamsikr Shell Programming and Scripting 2 07-01-2008 02:45 AM
Sudo: command not found cthinh UNIX for Dummies Questions & Answers 1 04-01-2008 11:31 AM
Sudo for a command synchro Solaris 1 03-17-2008 02:32 AM
problem with sudo su and .sh script cleansing_flame Shell Programming and Scripting 1 01-14-2008 03:32 PM



All times are GMT -4. The time now is 06:21 AM.