[Jan 06] Arch Linux (20171225-1) PINE A64(+) Pinebook A64-LTS/SOPINE | [Jan 04] Linux (0.5.15-136) ROCK64 | [Jan 04] Android (20171204) ROCK64 | [Dec 22] Stretch Mate (0.5.15-136-20171222) ROCK64 | [Dec 21] openHAB 2 (v1.4) PINE A64(+) | [Dec 11] Volumio (2.315) PINE A64(+) A64-LTS/SOPINE | [Dec 11] Armbian (5.35) PINE A64(+) Pinebook A64-LTS/SOPINE | [Dec 8] OpenMediaVault (0.5.15-136) ROCK64

Getting Started | Visit the WIKI | IRC Logs | Forum Rules/Policy


Recovering root access in Ubuntu
#1
Yesterday I had cause to add the ubuntu user to the www-data group. I believe I did this:

Code:
# usermod -G www-data ubuntu

Since then, I am unable to become root. If I try to sudo -i, I am told

Code:
Sorry, user ubuntu is not allowed to execute '/bin/bash' as root on pine64.

This happens no matter what command I try to run. sudo vim /etc/sudoers?


Code:
Sorry, user ubuntu is not allowed to execute '/usr/bin/vim /etc/sudoers' as root on pine64.


I don't actually know if adding ubuntu to a group caused this; it's just the biggest change I've made, and I can't think of anything else I've done that would cause this.

Thanks!
Reply
#2
(07-26-2017, 01:05 PM)Scientomancer Wrote: Yesterday I had cause to add the ubuntu user to the www-data group. I believe I did this:

Code:
# usermod -G www-data ubuntu

Since then, I am unable to become root. If I try to sudo -i, I am told

Code:
Sorry, user ubuntu is not allowed to execute '/bin/bash' as root on pine64.

This happens no matter what command I try to run. sudo vim /etc/sudoers?


Code:
Sorry, user ubuntu is not allowed to execute '/usr/bin/vim /etc/sudoers' as root on pine64.


I don't actually know if adding ubuntu to a group caused this; it's just the biggest change I've made, and I can't think of anything else I've done that would cause this.

Thanks!


hi,   hmmm  not run into anyone trying to do this to themselves before;

... do you really want anyone in the www-data group to also be in the soduers file ?   ... probably not.

While I'm not precisely sure what you have done to yourself, you can undo it by placing the SD card into another linux machine and mounting the ext4 partition containing /rootfs and removing the offending change.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
Reply
#3
(07-26-2017, 01:05 PM)Scientomancer Wrote: Yesterday I had cause to add the ubuntu user to the www-data group. I believe I did this:

Code:
# usermod -G www-data ubuntu

Since then, I am unable to become root. If I try to sudo -i, I am told

Code:
Sorry, user ubuntu is not allowed to execute '/bin/bash' as root on pine64.

Unfortunately, you haven't ADDED the ubuntu user to the www-data group, you've REPLACED the ubuntu primary user group with www-data, and consequently removed it from all other groups. For future reference, the command should have been -aG (yes, the a is important!). And because the root account is locked by default, unless you unlocked that, you can't log in as root to re-add ubuntu to the sudo group.

If you have another linux systen handy (or you can download VirtualBox and run a copy of ubuntu in a virtual machine, or make a bootable USB/CD), you could mount the ext4 partition, and edit /etc/groups, and re-add your username to the end. i.e. on my desktop, the sudo group line looks like this for the 'pfeerick' user. So just look for the sudo line, don't change the group number if it is different, and re-add ubuntu to the end. Then unmount, boot it back up, and see if it's fixed Wink

Code:
sudo:x:27:pfeerick
Reply
#4
I successfully recovered using the method suggested: mounting my system's filesystem on another machine and editing /etc/group. Thanks very much! Sorry that this didn't turn out to be a Pine specific question.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  SPI on ubuntu IlyaM 2 317 02-12-2018, 04:33 AM
Last Post: IlyaM
  After flashing Ubuntu- how to get graphical desktop Partymack711 6 199 02-01-2018, 09:45 AM
Last Post: Partymack711
  [Archival thread]Ubuntu Xenial Image (BSP Kernel) longsleep 337 116,136 01-31-2018, 11:58 AM
Last Post: Luke
  PPTP doesnt work with ubuntu escovedo 2 1,279 08-23-2017, 09:28 AM
Last Post: gilbertotcc
Question HELP Ubuntu Mate password recovery procedure Captain Anni Hilator 5 664 08-03-2017, 03:52 PM
Last Post: Luke
  Ubuntu boot very slow with wifi driver remainder 9 1,570 08-03-2017, 07:23 AM
Last Post: victorssantos
  Pine64 2Gb Ubuntu Mono not updating and stuck petec 0 229 07-08-2017, 09:34 AM
Last Post: petec
  Ubuntu Xenial - Firefox add support for H264 and EAC3 klode 1 961 05-26-2017, 11:10 AM
Last Post: Gnx
Brick Rootfs Encryption on Ubuntu 16.04 saro 7 776 05-17-2017, 06:49 PM
Last Post: pfeerick
  Updating Ubuntu 16.04 SteveBlack 9 3,220 05-05-2017, 01:33 PM
Last Post: ta2025

Forum Jump:


Users browsing this thread: 1 Guest(s)