The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sudo question melias Security 12 05-26-2008 01:10 AM
sudo, or not sudo: that is the question iBot UNIX and Linux RSS News 1 02-07-2008 10:40 AM
Sudo question Zarnick Linux 2 01-22-2008 05:25 AM
SUDO question - please help sajjad02 UNIX for Advanced & Expert Users 5 04-27-2005 08:22 AM
sudo question TRUEST UNIX for Dummies Questions & Answers 1 01-16-2004 09:53 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-15-2008
Registered User
 

Join Date: Oct 2007
Posts: 93
Sudo question

Folks;
I have a sudo question:
- I have a real user named "greg" and another generic user named "devuser" & application that must be run like start/stop as "devuser" user.
Is there a way to:

Have user Greg login into the Solaris 10 box as himself then sudo as "devuser" to be able to start/stop the application?
In other words: Can user Greg sudo to become "devuser" so when he does things as "devuser" i will be able to track what he did?
Reply With Quote
Forum Sponsor
  #2  
Old 01-15-2008
Registered User
 

Join Date: Dec 2007
Posts: 256
yes. all sudo actions are logged. just make sure whatever commands he has access to cannot escape out to a shell
Reply With Quote
  #3  
Old 01-16-2008
Registered User
 

Join Date: Oct 2007
Posts: 93
Thanks, but it would be very helpful if you tell me how to sudo as a user, like how can i use sudo in the "sudoer" file to allow users to sudo to become as "devuser"
Reply With Quote
  #4  
Old 01-16-2008
Registered User
 

Join Date: Dec 2007
Posts: 256
have you consulted the man pages or the documentation? There is much out there.
Reply With Quote
  #5  
Old 01-16-2008
Registered User
 

Join Date: Oct 2007
Posts: 93
Of course i did but i'm still having issues, that's why i was asking for help. for example, i have these two problems:

1. I used this form below to allow user Greg to login as generic user "devuser" which it worked fine with one problem: I want it to ask for a password so user "Greg" has to enter (his own password), but the problem is it doesn't ask for a password.

Greg server_name = (devuser) PASSWD: SHELLS, $CMD

2. If i don't want Greg to use a shell when sudo, how can i do that? in other word:
now Greg sudo as follow:
# sudo -u devuser tcsh

How can he sudo if i don't want him to use any shell like tcsh?
Reply With Quote
  #6  
Old 01-16-2008
Registered User
 

Join Date: Dec 2007
Posts: 256
1) the entry looks ok. Run this below. Does it prompt for a password now?

as user greg run the below and paste the output
Code:
sudo -K
sudo -u devuser allowed_command_here
sudo -l
2) if you do not want the user greg to run a shell then do not put the shell within the allowed command list or allow access to a command that can except to a shell or arbitrary command(ie: vi, more, less, etc..)
Reply With Quote
  #7  
Old 01-17-2008
Registered User
 

Join Date: Oct 2007
Posts: 93
The out put from "sudo -k" doesn't return any thing.
The output from "sudo -l" returns:

User Greg may run the following commands on this host:
(devuser) NOPASSWD: ALL
(devuser) NOPASSWD: !SHELLS
(devuser) NOPASSWD: !SU
(root) ALL
(root) /bin/ksh, /usr/bin/ksh, /bin/csh, /usr/bin/csh, /bin/sh, /usr/bin/sh, /sbin/sh, /usr/bin/tcsh
(root) !SU
usr/local/apache2/bin/apachectl


Also; i was asking how can user Greg sudo as "devuser" user so when he sudo he becomes "devuser" so he doesn't have to type sudo before every command he needs to run as "devuser", in other word, how can he sudo to become "devuser" to make the prompt changes from:
#Greg@server>
to
#devuser@server>


I hope i'm making it this question clear enough
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0