Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-26-2012
Registered User
 
Join Date: Jun 2012
Location: Santa Catarina
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Bug sudo su - user not working

Hi All, I need your expertise to solve my problem, my account has permission to make sudo and su but when I try to switch user in a shell, it does not work with following message:
"Sorry, user jmbeltra is not allowed to execute '/usr/bin/su -c echo HELLO THERE - oracle' as root on dbbr1k01"
I logged on with my personal account (jmbeltra) and try to switch to oracle account into a shell.
Could you assist me about ??
Sponsored Links
    #2  
Old 06-26-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,400
Thanks: 492
Thanked 2,537 Times in 2,420 Posts
It means what it says. Sudo is not configured to let you do that. Ask your administrator to configure it for you.
Sponsored Links
    #3  
Old 06-26-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,657
Thanks: 164
Thanked 646 Times in 623 Posts
try this as a command note the double quotes

Code:
sudo su - oracle -c "echo 'hi there' "

the syntax is su - [username] -c " [command] "
The quotes are need if command is more than one word.

I think it is a syntax problem -
    #4  
Old 06-26-2012
Registered User
 
Join Date: Jun 2012
Location: Santa Catarina
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for your prompt answers, so I've tried with different similar syntaxis ways as
sudo su - oracle -c "command"
sudo su - oracle "-c command"
sudo su - oracle -c 'command';

and result the same
Also an SA checked out configuration and it looks fine, in fact I can do this in commnad line properly good, the point is into a shell is when it doesn't work
Sponsored Links
    #5  
Old 06-26-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,400
Thanks: 492
Thanked 2,537 Times in 2,420 Posts
There's nothing wrong with it per-se. They simply haven't configured sudo to allow you to do it. sudo can be used in a variety of ways, and they don't have to let you use it that way if they don't actually want to.

Ask your administrator to do so.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sudo is not working properly getrue Red Hat 5 07-27-2011 10:08 AM
sudo inside a here document not working mnanavati Shell Programming and Scripting 13 11-22-2010 06:11 PM
sudo + ulimit not working ? cyler Shell Programming and Scripting 3 06-07-2010 10:10 AM
Sudo command not working with cron job. WhotheWhat Shell Programming and Scripting 6 12-18-2008 03:10 PM
sudo chmod not working Movomito UNIX for Advanced & Expert Users 1 06-05-2008 02:41 AM



All times are GMT -4. The time now is 08:41 PM.