I want a user to be able to change to another user without a password and any other root rights. I followed already a hint on https://apple.stackexchange.com/questions/82438/allow-sudo-to-another-user-without-password but it didn't work for me.
I've edited the sudoers with visudo and added following line:
test1 ALL=(test2:test2) NOPASSWD:ALL
I've tried also:
test1 ALL=(test2) NOPASSWD:ALL
But if I try to change to this user as user test1 with:
sudo su test2
I get always a prompt for a password of user test1. If I type the password I get the error Sorry, user test1 is not allowed to execute '/bin/su -u test2' as root on host.example.com
Well, I've searched already through Google & Co but I find only the way above with the entry in the sudoers which doesn't work actually.
I hope somebody can help me :-)
Thanks
So I have already found the solution: