Sudo question

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sudo question
# 1  
Old 01-15-2008
Sudo question

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?
# 2  
Old 01-15-2008
yes. all sudo actions are logged. just make sure whatever commands he has access to cannot escape out to a shell
# 3  
Old 01-16-2008
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"
# 4  
Old 01-16-2008
have you consulted the man pages or the documentation? There is much out there.
# 5  
Old 01-17-2008
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?
# 6  
Old 01-17-2008
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
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..)
# 7  
Old 01-17-2008
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: !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

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:

I hope i'm making it this question clear enough
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Sudo question

I am running AIX and am experiencing a problem using sudo. I have shell scripts that I created for our HR user and shell scripts that I created for root administrators. I do have a need to embed a sudo command in the user shell script to run one command as root. However the two... (8 Replies)
Discussion started by: RonDeF
8 Replies

2. UNIX for Advanced & Expert Users

Sudo question

Hi All I want to grant elevated privs to a user that will be running a script as a background task. It will be launched from an ssh session via an embedded command in its key that just allows that account to run that script. I'm reading up on sudo and notice that - user ALL=(ALL) ALL ... (2 Replies)
Discussion started by: steadyonabix
2 Replies

3. UNIX for Dummies Questions & Answers

Question about sudo

Hello all, I have a script ( that is owned and executed by root. Now I need to give another user (user1) sudo access to execute that script. I edited the /etc/sudoers file, and created the following: # Runas alias specification Runas_Alias RO = root user1 ALL=(RO)... (1 Reply)
Discussion started by: designbc
1 Replies

4. UNIX for Dummies Questions & Answers

Sudo question

Folks; I have SUDO configured on my SUSE boxes to allow a specific groups to run specific duties so one group has ALL permission & other group has permission to run a few commands only. when i look at the sudoer log, i see people login info only, Is there a way to capture every thing users do... (3 Replies)
Discussion started by: Katkota
3 Replies

5. Ubuntu

sudo question.

Hello all, Anyone fimilar with su -l command? So when I do su -l <user> any user it doesn't prompt me for password for that user. How I enable sudo to prompt for password whenever su -l command is used. Please help! thanks, -Lalit :D (7 Replies)
Discussion started by: email-lalit
7 Replies

6. Cybersecurity

sudo question

Hi, Is it possible to stop users from copying a login shell, say bash, to another name and then executing it via sudo to gain root priviliges? Normal users have read access to login shells, so they can copy them without any limitations. How can I stop this? Thanks (12 Replies)
Discussion started by: melias
12 Replies

7. Linux

Sudo question

Hello, I would like to know what should I put on the sudoers file to block a determined group os using just one specific command as root? He can do anything, but not execute program X, how can I do this? Thank you very much. (2 Replies)
Discussion started by: Zarnick
2 Replies

8. UNIX for Advanced & Expert Users

SUDO question - please help

Hi, I was wondering if someone can give me some pointers about configuring SUDO. I am trying to configure SUDO to have about 30 users run about 200 scripts as a different user. I understand that I can create an User_Alias but how do I give that User_Alias rights to run all the scripts in a certain... (5 Replies)
Discussion started by: sajjad02
5 Replies

9. UNIX for Dummies Questions & Answers

sudo question

how do i go about adding a file to sudo so a user name oracle can run the file??? for some reason my man pages dont have anything for sudo. files sudoers exist in /etc can anyone help this is urgent thank you (1 Reply)
Discussion started by: TRUEST
1 Replies
Login or Register to Ask a Question