How do I allow only one user to su to another account?
29,259
su
is not meant to do that -- sudo
is.
Open /etc/sudoers.d/custom
and write the following:
user-a ALL=(user-b:user-b) NOPASSWD:ALL
Which means: whenever user-a executes sudo -u user-b
(or any other variant), let him go without asking for password.
Related videos on Youtube
Author by
Wojtek
Updated on September 18, 2022Comments
-
Wojtek almost 2 years
I have user-a and user-b on my box.
How do I do a no-password
su - user-b
as user-a? -
Wojtek over 10 yearsThat worked. All I needed to do than was 'sudo -u user-b bash'