# Have sudo require root password instead of user?

## Sydero

Is it possible to have sudo require the root password for the elevation of privleges instead of the user's? I realize that su is one way of going about this, but I'd like it to be per process for convenience instead of logging in and out for least access. Or is there a more secure way or elevating privleges?

Thanks

----------

## marduk

IMO forums are *much* slower and less accurate than the system documentation:

```

       rootpw          If set, sudo will prompt for the root password instead

                       of the password of the invoking user.  This flag is off

                       by default.

```

----------

## idella4

yes it is possible.  get a suse and see, it requests the root password on sudo

----------

## Sydero

Thanks, rootpw worked.  However now I have the problem that when I type su and the root password, I receive the error permission denied.  Could this be because I changed defaults from %wheel to ALL and added ALL ALL=(ALL) ALL?

Here's my sudoers file: http://www.pastebin.ca/1697578

----------

## Nerevar

If you're ok with entering the password for each command, "su -c <command>" works well.

----------

## Sydero

 *Nerevar wrote:*   

> If you're ok with entering the password for each command, "su -c <command>" works well.

 

Is it possible to "symlink" or make script out of it so that typing sudo does the same thing? And by using su to emerge instead of sudo, wouldn't my config files be located in the root's home and not mine?

----------

## Nerevar

I'm not aware of any config files emerge uses that are located in a home directory (root or otherwise). You can use the -p option to su though if you want to preserve the current environment settings.

----------

