I need to allow a limited user to sudo su to another limited user, but just the other user and no other users. Especially not root. How can I accomplish this?
Thanks!!
I need to allow a limited user to sudo su to another limited user, but just the other user and no other users. Especially not root. How can I accomplish this?
Thanks!!
Registered Linux User: 450747 Registered Ubuntu User: 16269
It's hard to find good material about sudo, but if you are interested in knowing a lot about it and how to configure sudoers, you might look at Michael W Lucas' book Sudo Mastery
But to answer the question, the following settings in sudoers would let anyone in the group "ant2ne" run the program "whoami" as the user / group "foobar", but only without any options:
Then that those users could run.Code:%ant2ne ALL=(foobar:foobar) /usr/bin/whoami ""
It's worth taking a look at the manual page for sudoers. It will be overwhelming at first, but you'll pick up something each time.Code:sudo -u foobar whoami
You do not need sudo to switch users.
simply
All you need is the other users password.Code:su <otheruser>
This can also be applied to su for root.
The reason people use sudo is because root typically, at least on Ubuntu, does not have a password and sudo will cover that.
If that makes sense.
Or if that's helpful?
Splat Double Splat Triple Splat
Earn Your Keep
Don't mind me, I'm only passing through.
Once in a blue moon, I'm actually helpful.
deadflower: I do not want the first user to know the second users password. Not only that, with security lockdowns su is only executable by sudo.
lars: I will try what you suggest on Monday.
Registered Linux User: 450747 Registered Ubuntu User: 16269
The settings above in #2 will allow you to run a specific program as that other user. If you really need to login as that other user but without giving away the password to that account, then you will have to run su as root via sudo. But it can be locked down to not give any leeway for other options.
Code:%ant2ne ALL=(root:root) /bin/su foobar
Registered Linux User: 450747 Registered Ubuntu User: 16269
Bookmarks