-1

This issue popped up about a week ago, not sure what caused it. Previously the environment had been working as expected. Using a VM hosted on VMWare tools, uname -a returns roughly the following.

-virtual-machine 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

For example, sudo su root returns

"Sorry, user linuxUser is not allowed to execute '/bin/su root' as root on linuxUser-virtual-machine."

sudo apt-get install vim

"Sorry, user linuxUser is not allowed to execute '/usr/bin/apt-get install vim' as root on linuxUser-virtual-machine".

However I can execute commands as linuxUser, like ls -la or vim.

id returns the following

uid=1000(linuxUser) gid=1000(linuxUser) groups=1000(linuxUser),999(docker)

What I've tried

  1. editing sudodoers, I can't modify the file because I don't have root access
  2. Changing linuxUser's password, had no effect

I've googled around pretty heavily on this, but it seems like most users are either still able to execute sudo commands or are still able to switch to root. Any ideas?

sudo -l -U linuxUser returns the following

Matching Defaults entries for linuxUser on linuxUser-virtual-machine:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User linuxUser may run the following commands on linuxUser-virtual-machine:
(root) NOPASSWD: /usr/lib/linuxmint/mintUpdate/checkAPT.py

POSTMORTEM EDIT: Hey All, I fixed the issue with https://askubuntu.com/questions/70442/how-do-i-add-myself-back-as-a-sudo-user. Thanks for the help!

closed as off-topic by Jeff Schaller, msp9011, jimmij, Dmitry Grigoryev, thrig Aug 16 '18 at 15:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, msp9011, jimmij, Dmitry Grigoryev, thrig
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    if you have taken yourself out of the sudo group by accident, you wont be able to use sudo. – Rui F Ribeiro Aug 15 '18 at 13:07
  • Perhaps you don't have root authority on this system? – Jeff Schaller Aug 15 '18 at 13:08
  • You should show the sudodoers file. Did you change something in that file? – RalfFriedl Aug 15 '18 at 13:09
  • @RalfFriedl, not sure how to view sudodoers without admin access. The file has not been modified since 2017. – ronald mcdolittle Aug 15 '18 at 13:12
  • @JeffSchaller how can I check if I have authority? – ronald mcdolittle Aug 15 '18 at 13:12
2
User linuxUser may run the following commands on linuxUser-virtual-machine:
(root) NOPASSWD: /usr/lib/linuxmint/mintUpdate/checkAPT.py

Well, that rather plainly says that you're not authorized (as far as sudo is concerned) to run anything other than that script.

If you were allowed to run arbitrary commands, there would be a line in the output to that effect:

User thisuser may run the following commands on thishost:
    (ALL : ALL) ALL
    (root) NOPASSWD: /some/other/utility

That access could be given by username, or by group membership.

someuser   ALL=(ALL:ALL) ALL          # by user
%sudo      ALL=(ALL:ALL) ALL          # by group

If the /etc/sudoers file has not been modified, then perhaps your membership in the sudo group has been removed (the group could have some other name, of course)?

There's no way to know, without seeing the configuration, which you can't see without sufficient access. Reinstall and restore from backups, or open the disk (image) in another system where you have enough access.

  • Quite the opposite, actually. (root) NOPASSWD: /usr/lib/linuxmint/mintUpdate/checkAPT.py indicates that the user is allowed to run that script with no password. I don't see any indication that the user is allowed to run anything other than that. – Tim Kennedy Aug 15 '18 at 14:42
  • 1
    @TimKennedy, added the missing negation to the first sentence... thanks. – ilkkachu Aug 15 '18 at 14:43
  • Accepting this because it was the closest, the easy fix was to do askubuntu.com/questions/70442/… – ronald mcdolittle Aug 16 '18 at 14:07
0

Try to mount the system disk (system disk file) to a reliable linux system where you have the root rights. Then you can investigate the passwd, group, sudoers and all other relevant files, and/or you can use chroot to enter into the failing system.

0

Note that Sorry, user %s is not allowed to execute '%s%s%s' as %s%s%s on %s. is a different error to %s is not in the sudoers file. (I have not read source, I just ran strings in the code in /usr/lib/sudo/*.)

Therefore you may still be in sudoers file. Someone may have reconfigured it. Try various commands, you may find something that will help you. If not then you need to mount the disk on a different OS instance, and fix it.

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