1753826 Members
8585 Online
108805 Solutions
New Discussion юеВ

Re: Sudo issues

 
amipankaj
Frequent Advisor

Sudo issues

Hello Experts,

i have one problem with sudoers file. i have three user john, paull, vrao i wanted these users can become user mark. for that, i had added following lines in sudoers file.

User_Alias SABADEVS = john, paul, vrao
Runas_Alias SABA = mark
SABADEVS ALL = (SABA) NOPASSWD:ALL

but its not working....asking for password while trying to switch to user mark from these three users.

thanks in adance.
Roy
4 REPLIES 4
Frank de Vries
Respected Contributor

Re: Sudo issues

I see you use :ALL
but to change user you need
"su - mark "

Did you try to narrow just for su ?

Cmnd_Alias SU = /usr/bin/su
SABADEVS ALL = (SABA) NOPASSWD:SU

Or alternatively does it work just
plain SU (for everyone to start)

User_Alias SABADEVS = john, paul, vrao
Cmnd_Alias SU = /usr/bin/su
SABADEVS ALL = (SABA) NOPASSWD:SU
Look before you leap
killer1
Advisor

Re: Sudo issues

Hello Roy

Please try the following syntax.

User_Alias SABADEVS = john, paul, vrao
SABADEVS ALL = NOPASSWD:/usr/bin/su - mark

Regards
Matti_Kurkela
Honored Contributor

Re: Sudo issues

If your users are using the "sudo su - mark" construct, they're effectively asking sudo to allow them to become root so that su can switch them to mark without asking for a password. Your sudo configuration does not allow that.

With the rules you have specified, your users should use "sudo -u mark -i". It achieves the same result as "sudo su - mark", but in a different way.

MK
MK
amipankaj
Frequent Advisor

Re: Sudo issues

Thanks guys....its working now.