LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sudo access requirement (https://www.linuxquestions.org/questions/linux-server-73/sudo-access-requirement-918743/)

ranjit rajput 12-14-2011 02:02 PM

Sudo access requirement
 
Hi All,

I am facing following problem.
We are having 2 user named jzappa and imany.
right now jzappa have sudo access but we have to remove it now.imany have sudo access.

Now user need to able to 'su' to imany from jzappa and then to 'sudo su' to root from imany.

How to make entry in /etc/sudoers files.

Ranjit Rajput

qwertyomen 12-14-2011 02:10 PM

I'm not certain what your trying to do here... do you want sudo privileges without a password? are you trying to get each account sudo privileges?

ranjit rajput 12-14-2011 02:29 PM

Sudo access
 
Thanks...

i want 1)jzappa user only able to su to imany user.2)imany user is able to sudo su to root.

how to make entry in /etc/sudoers ?

Ranjit

TB0ne 12-14-2011 02:50 PM

Quote:

Originally Posted by ranjit rajput (Post 4549958)
Thanks...
i want 1)jzappa user only able to su to imany user.2)imany user is able to sudo su to root. how to make entry in /etc/sudoers ?

In the scenario you described, why bother??

If the jzappa users logs in, and can su to imany, and from THERE, get root access, they can easily edit anything they want, including the sudoers file. What you're describing is pointless. I suggest you read the sudoers manual, and see any of the examples you can find online.

http://www.gratisoft.us/sudo/sudoers.man.html
http://serverfault.com/questions/367...users-commands

You can put
Code:

User_Alias RESUSER = jzappa
RESUSER ALL = !/usr/bin/su, !SHELLS, <any other commands you don't want them to run>, /bin/su imany

and jzappa will only be able to su to imany. Based on your other posts, you never follow up or answer questions, so I'm not sure what you'll do with this.

ranjit rajput 12-14-2011 03:50 PM

Hi

after putting below, it is asking for password for imany.I dont want that when i switch from

jzappa to imany it dont ask for password.

User_Alias RESUSER = jzappa
RESUSER ALL = NOPASSWD: !/usr/bin/su,/bin/su imany

Kindly suggest.

TB0ne 12-14-2011 04:22 PM

Quote:

Originally Posted by ranjit rajput (Post 4550017)
Hi
after putting below, it is asking for password for imany.I dont want that when i switch from jzappa to imany it dont ask for password.

User_Alias RESUSER = jzappa
RESUSER ALL = NOPASSWD: !/usr/bin/su,/bin/su imany

Kindly suggest.

Ok...again, I'll 'kindly suggest' you read the sudoers manual. If your user is set up to authenticate as part of a group, then no matter what you specify in the command alias group, they'll still have to. You don't post your sudoers file, so it's hard to say. And again, what you are doing is pointless. If the user can become root via another user ID, they're totally bypassing what sudo is for, and can do whatever they want.


All times are GMT -5. The time now is 11:24 PM.