The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sudo sydney2008 UNIX for Dummies Questions & Answers 3 08-25-2008 02:34 AM
Sudo error rainbow_bean AIX 1 02-28-2008 07:00 AM
sudo, or not sudo: that is the question iBot UNIX and Linux RSS News 1 02-07-2008 01:40 PM
Help with Sudo geomonap UNIX for Advanced & Expert Users 1 03-29-2006 04:50 PM
Help Me About Sudo binhnx2000 UNIX for Dummies Questions & Answers 3 10-01-2002 04:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-18-2008
karayan karayan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 4
sudo su error

Hello,

I am logging to a server using username 'test'. I want to execute some commands as user test2.

When I am trying to run `sudo su - test2 -c 'ls'` it gives error user 'test' is not allowed to run sudo in host. But when I login into the account 'test2' using sudo su - test2 all these commands work.

Is there any way I can get this working? I need to do that because I want to run this command from a script. I think it is related to permissions for user test. Please advise.

Regards,
Saura
  #2 (permalink)  
Old 11-18-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
Ask sysadmin to add test user to sudoers file.
  #3 (permalink)  
Old 11-18-2008
karayan karayan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 4
But I am able to sudo su - test2 as test user. Which means test user is in sudo file isnt it?

Thanks for your reply.
  #4 (permalink)  
Old 11-19-2008
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,585
Ok then what is the output of sudo -l when you are user test?
  #5 (permalink)  
Old 11-19-2008
karayan karayan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 4
sudo -l show that I can execute only sudo - su test2. Editing the sudoers file should solve the problem right?

Is it possible to add an entry such that the user can execute sudo -su test2 -c 'whatever command he wants with options'

Thanks for the reply.
  #6 (permalink)  
Old 11-19-2008
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,585
in sudoers file:

test ALL = NOPASSWD : /usr/bin/su - test2 *
  #7 (permalink)  
Old 11-19-2008
karayan karayan is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 4
Thank you..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0