0

I am very used to using sudo -l -U <user> to check another user's sudo capabilities but since version 18.04 I can no longer see this. It always comes back blank.

Is there some special setting I need to tweak?


Update

The user I am executing this with has the following permissions

    (ALL : ALL) ALL
    (ALL : ALL) NOPASSWD: ALL

as shown after executing sudo -l


Update2

the return code when I execute the command is 1

$ sudo -l -U other_user
$ echo $?
1
3
  • Are you sure the checking user has the ALL sudo privilege?
    – FedKad
    Mar 20, 2020 at 12:58
  • Yes. I added the update for clarity
    – hanzo2001
    Mar 20, 2020 at 13:04
  • Do you say that the sudo -l -U command returns no output? What about the return code? (echo $?). The command should display something. Can you try once more and edit your post by adding the command AND its output?
    – FedKad
    Mar 20, 2020 at 13:29

1 Answer 1

0

The man page for sudo describes the -U option like this:

-U user, --other-user=user

    Used in conjunction with the -l option to list the privileges for user
    instead of for the invoking user. The security policy may restrict
    listing other users' privileges. The sudoers policy only allows root or
    a user with the ALL privilege on the current host to use this option.

This option has not changed since at least Ubuntu 14.04. So, the user who checks this need to have ALL privilege on the system.

6
  • Yes. I added the update for clarity
    – hanzo2001
    Mar 20, 2020 at 13:04
  • Is it possible that because the user I am using is logging in remotely to check on a local user, that this permission is restricted?
    – hanzo2001
    Mar 20, 2020 at 13:06
  • I tested that. It makes no difference..
    – FedKad
    Mar 20, 2020 at 13:35
  • Added what you asked for. I am tempted to look at the system logs again. Maybe I'm missing something, last time I checked I couldn't find anything relevant in sys nor auth
    – hanzo2001
    Mar 20, 2020 at 15:07
  • Hey, wait a sec. The user I'm trying to check is not a local user. He is defined in an LDAP service on a remote machine. Could this also be related? I use SSS to manage authentication and credential caching
    – hanzo2001
    Mar 20, 2020 at 15:08

You must log in to answer this question.

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