"sudo -u <user> -i" works but "sudo su - <user>" doesn't
I have 3 VM's running Red Hat Enterprise Linux Server release 7.0 (Maipo), let's call them SysA, SysB and SysC.
I have configured sudo for UserA to be able to sudo to UserB.
UserA ALL=(UserB) ALL
On SysA and SysB this works fine, logged on as UserA issuing "sudo -u UserB -i" or "sudo su - UserB".
On SysC "sudo su - UserB" gives me the following error:
Sorry, user UserA is not allowed to execute '/bin/su - UserB' as root on SysC.
However, "sudo -u UserB -i" works.
Have anyone got a clue about how to solve this?
The easy solution is of course to use "sudo -u UserB -i" but it feels like a work around. Before surrendering I'd like to check if anyone has a clue about this.
Best regards,
Christian