lost root access

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

lost root access

Jack McGee
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
> mythuser@192.168.1.105'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.

I rebooted and not change.
I tried this:
https://help.ubuntu.com/community/LostPassword

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?


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: lost root access

Ian Bruntlett
Hi Jack,

On Sun, 6 Jan 2019 at 20:38, Jack McGee <[hidden email]> wrote:
I had a user on a 18.04 machine that had root access, using sudo, but it
lost it.  This just between reboots.

I believe sudo access can be added by using the rescatux live CD [1] and I checked for info and found this YouTube video [2]

[2] https://www.youtube.com/watch?v=DAnmvaGvDfc

HTH,


Ian

--
-- ACCU - Professionalism in programming - http://www.accu.org
-- My writing - https://sites.google.com/site/ianbruntlett/


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: lost root access

Matthew Crews
In reply to this post by Jack McGee
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.
*snip*
>
> 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.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: lost root access

Rashkae-2
In reply to this post by Jack McGee
On 2019-01-06 3:35 p.m., Jack McGee wrote:

>
> 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;

example:

sudo:x:27:mythuser

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.




--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: lost root access

Jack McGee
In reply to this post by Matthew Crews
On 1/6/19 2:57 PM, Matthew Crews wrote:

> 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.
> *snip*
>>
>> 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.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: lost root access

Matthew Crews
On 1/6/19 6:48 PM, Jack McGee wrote:

> 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.

Hard to say though without pouring through logs.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users