-2

My main problem is that I cannot use sudo. My root account is locked using sudo passwd -dl root.

I have two users on my machine. root and admin, admin does not have su permission. When I try to use sudo on admin user, it says that admin is not in the sudoers file.

When I try to use su while logged in admin user

su: Authentication failure

and when I try to use sudo

admin is not in the sudoers file.  This incident will be reported.

can I unlock my root user back?

1 Answers1

0

Try this:

pkexec gedit /etc/sudoers

Then change this:

#%admin ALL=(ALL) ALL

To

%admin ALL=(ALL) ALL

Not sure if that will do it because my situation was different but I hope so!

  • 4
    And when asked by pkexec for a root password what exactly would you type provided the account is disabled? – techraf Aug 24 '16 at 04:36
  • @techraf By default, pkexec asks for the password of the user who runs it, and checks if they are allowed to do what they are trying to do with it (like sudo). pkexec may also display a list of authorized users and ask you to pick which one you wish to authenticate as. Do you have an Ubuntu system where pkexec just asks for root's password *even when run by someone in the sudo (or on older systems, admin) group? If so, is the root password enabled on this system, and has Polkit's configuration even been edited? – Eliah Kagan Jan 29 '17 at 16:39
  • The question explicitly says admin is not enabled for sudo, neither directly nor through a group membership. pkexec will display "Password for root:" prompt in this case. What is the point of your comment? – techraf Jan 29 '17 at 22:07