2

I have two users in my CentOS system User1 and User2. I am logged in as root user and trying to add User1 to sudoer list using visudo. I have entered the following line at the end of the file

User1 ALL = (ALL) NOPASSWD: ALL

But, when I log in as User1 the su User2 command gives me a password prompt. I do not want to provide password and instead User1 should be able to switch to User2 without any password.

1 Answer 1

5

The /etc/sudoers config file doesn't configure the su command, which will always prompt for credentials in accordance with whatever's in /etc/pam.d/su. The command you're looking for is sudo -iu User2

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .