I had a user on a 18.04 machine that had root access, using sudo, but it
lost it. This just between reboots.
> jmcgee@jmcgee-desktop:~$ ssh -l mythuser 192.168.1.105
> email@example.com's password:
> Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-42-generic x86_64)
> * Documentation: https://help.ubuntu.com > * Management: https://landscape.canonical.com > * Support: https://ubuntu.com/advantage >
> * MicroK8s is Kubernetes in a snap. Made by devs for devs.
> One quick install on a workstation, VM, or appliance.
> - https://bit.ly/microk8s >
> * Full K8s GPU support is now available!
> - https://blog.ubuntu.com/2018/12/10/using-gpgpus-with-kubernetes >
> * Canonical Livepatch is available for installation.
> - Reduce system reboots and improve kernel security. Activate at:
> https://ubuntu.com/livepatch >
> 13 packages can be updated.
> 12 updates are security updates.
> You have packages from the Hardware Enablement Stack (HWE) installed that
> are going out of support on 2023-04-30.
> There is a graphics stack installed on this system. An upgrade to a
> configuration supported for the full lifetime of the LTS will become
> available on 2020-07-21 and can be installed by running 'update-manager'
> in the Dash.
> Last login: Sun Jan 6 14:19:31 2019 from 192.168.1.64
> mythuser@amethi:~$ sudo ls
> [sudo] password for mythuser:
> mythuser is not in the sudoers file. This incident will be reported.
> but I don't see a Grub menu, just drops to XFCE desktop after bios
> splash. Holding down shift key.
> How I get root access back?
Your system BIOS might have a "Legacy USB" or "USB Keyboard" option
disabled. Grub will need that support to work with a USB keyboard.
If you can't get it to work that way, you can use a usb or DVD boot
media to mount your root filesystem and directly edit the
/boot/grub/grub.cfg file... Make you you make a backup of it first.
Find the first 'menuentry' section and append the init=/bin/bash to the
end of the Linux line.
It might be easier/safer from your current position to edit your
/etc/group file instead, and add mythuser to the sudo group;
Alternatively, if it's your /etc/sudoers file that has become broken,
hopefully to remember what was changed to break it.
Directly modifying system files like this can be dangerous.. (no
explosions or fire, usually, but can make recovery of a working system,
and especially, saving of important data, more difficult.) If my
suggestions are not easy for you to understand, I would suggest getting
some hands on assistance for this.
> On 1/6/19 1:35 PM, Jack McGee wrote:
>> I had a user on a 18.04 machine that had root access, using sudo, but it
>> lost it. This just between reboots.
>> How I get root access back?
> First, I would double check that you are logged into a user that is
> supposed to have root access. Silly, I know, but extra sanity checks
> never hurt.
> Assuming that is correct, I would fire up an Ubuntu Live disk, and
> modify your /etc/sudoers file to include something like this:
> # User privilege specification
> mythuser ALL=(ALL:ALL) ALL
> Then reboot the box as normal, and it should work.
Booting with Live USB and editing sudoers worked. Thank you! I sure
would like to know how it changed to take that user out.
> Booting with Live USB and editing sudoers worked. Thank you! I sure
> would like to know how it changed to take that user out.
My best guess is that something went wonky with your sudoers file during
the update process that you performed. Its possible it got reverted to a
default config. Either that or your user account got removed from the
sudo group and/or the sudo group was removed.