sudo su - user not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sudo su - user not working
# 1  
Old 06-26-2012
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 ?? Smilie
# 2  
Old 06-26-2012
It means what it says. Sudo is not configured to let you do that. Ask your administrator to configure it for you.
# 3  
Old 06-26-2012
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
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
# 5  
Old 06-26-2012
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Sudo not working on LDAP client machine

Hi, I have configured ldap manually on solaris 10/11 machine with below entries: # ldapclient list |grep sudo NS_LDAP_SERVICE_SEARCH_DESC= sudoers:ou=SUDOers,dc=exm,dc=ple,dc=com # cat /etc/nsswitch.conf |grep -i sudo sudoers: files ldap # But groups available in LDAP server... (8 Replies)
Discussion started by: Sridaran
8 Replies

2. Solaris

Sudo Not working on Solaris 10

Hi All, im a bit new to Solaris 10 iv been working on Redhat and cant seem to get the sudo working on Solaris 10:D Iv installed the below packages via pkgadd command: gcc-4.7.2-sol10-x86-local libiconv-1.14-sol10-x86-local libintl-3.4.0-sol10-x86-local sudo-1.8.13-sol10-x86-local ... (1 Reply)
Discussion started by: SolarisRSA
1 Replies

3. Shell Programming and Scripting

How to automatically run commands after SSH and SUDO not working?

I'm working on a script to SSH and SUDO as (sap user sidadm) then automatically run commands that the sidadm user can run such as R3trans -v, tp, etc.. I can SSH without password and SUDO.. but the commands don't run after I SSH and SUDO to the sidadm user...here is the commands that I've... (2 Replies)
Discussion started by: icemanj
2 Replies

4. Red Hat

sudo is not working properly

This is the first time for using sudo for me. # visudo ## Allows people in group admin to run all commands %admin ALL=(ALL) ALL # groupadd admin # useradd temp # usermod -a -G admin temp # id temp uid=506(temp) gid=506(temp) groups=506(temp),507(admin) # #sudo... (5 Replies)
Discussion started by: getrue
5 Replies

5. Shell Programming and Scripting

sudo inside a here document not working

Have a sudo statement inside of a here document. It prompts me for a password, but doesnt wait for me to enter my password. Is there a way I can use the command without sudo or anyway that I can enter the password correctly? Eg : while read remotehost do ssh -t $2@$remotehost <<REMOTE... (13 Replies)
Discussion started by: mnanavati
13 Replies

6. Shell Programming and Scripting

sudo chmod not working through script

Legends, I am trying sudo chmod from one shell to different machine. but getting the error. Please let me know if there is any way to do this. A#pk} for i in Bl1 Brl1 >> do >> echo $i >> ssh $i sudo chmod 755 /etc/services >> done Bl1 Password: bash: sudo: command not found ... (2 Replies)
Discussion started by: sdosanjh
2 Replies

7. Shell Programming and Scripting

sudo + ulimit not working ?

When I use sudo with ulimit there is an error but if I use ulimit without sudo there is no error. In bash: user1@debian:~$ sudo -u user2 -H ulimit -S -c unlimited sudo: ulimit: command not found user1@debian:~$ user1@debian:/home/user1$ ulimit -S -c unlimited user1@debian:/home/user1$... (3 Replies)
Discussion started by: cyler
3 Replies

8. UNIX for Dummies Questions & Answers

sudo apt-get install build-essential not working

it asks for password and then following is displayed Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package build-essential what should i do to install g++ compiler? (4 Replies)
Discussion started by: sparkle
4 Replies

9. Shell Programming and Scripting

Sudo command not working with cron job.

Hello, I have written a script that has a sudo command to change file permissions within it. When I run the script manually, the sudo command inside of it works fine. When the script is run through crontab I get the error "cron: not found". It the same user profile that I am using... (6 Replies)
Discussion started by: WhotheWhat
6 Replies

10. UNIX for Advanced & Expert Users

sudo chmod not working

now running mac os x 10.53 and sudo chmod comes back with : operation not permitted. sample file: -rwxr-xr-x+ 1 1000 com.apple.monitor_all_services 276592 Jun 8 2007 342345.tif i am running as root. (1 Reply)
Discussion started by: Movomito
1 Replies
Login or Register to Ask a Question