If a server has the following in /etc/sudoers:

Defaults targetpw
ALL ALL=(ALL) ALL

Then what does this mean? all the users can sudo to all the commands, only their password is needed?

  • 5
    It means "security Nirvana", that's what it means. ;) – lcd047 May 6 '15 at 20:51
up vote 6 down vote accepted

From the sudoers(5) man page:

The sudoers policy plugin determines a user's sudo privileges.

For the targetpw:

sudo will prompt for the password of the user specified by the -u option (defaults to root) instead of the password of the invoking user when running a command or editing a file.

sudo(8) allows you to execute commands as someone else

So, basically it says that any user can run any command on any host as any user and yes, the user just has to authenticate, but with the password of the other user, in order to run anything.

The first ALL is the users allowed
The second one is the hosts
The third one is the user as you are running the command
The last one is the commands allowed
  • Thanks! In the meantime I found the "Defaults targetpw" entry in sudoers.. updated the Q – LoukiosValentine79 May 7 '15 at 16:37
  • @LoukiosValentine79 I just update the answer, does that answer your question? – poz2k4444 May 7 '15 at 18:24
  • wait he has to enter his own password not of the other user right? – evan54 Feb 28 '16 at 20:24
  • with targetpw the one of the other (target) user – x-yuri May 19 '17 at 12:20

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.