Sam Sam - 5 months ago 14
Linux Question

How to execute sudo as user with root password

How can I configure Linux to see the prompt for the root password if

Sam
try to execute the following command:
$ sudo mkdir /opt/test
?

If
Sam
is part of sudoers, the terminal ask for the user password not for the root password.

Answer

In /etc/sudoers, add this line:

Defaults rootpw

Make sure you use visudo for editing this file. For more information, you can check the link