sudoers file problem with upgrade to 22.04

Ralf Mardorf kde.lists at yahoo.com
Mon Aug 15 20:51:09 UTC 2022


On Mon, 2022-08-15 at 12:32 -0500, Jack McGee wrote:
> Can this be repaired from bootable USB 22.04 stick?

Hi,

yes! By either chroot from a live media, see
https://help.ubuntu.com/community/LiveCdRecovery or by using
systemd-nspawn from a live media (or from another Linux install on the
same machine).

While systemd-nspawn can't replace a chroot for all purposes, running
visudo works. I made a short test using systemd-nspawn.

[root at archlinux rocketmouse]# systemd-nspawn -qD /mnt/moonstudio/ lsb_release -rc
Release:	16.04
Codename:	xenial
[root at archlinux rocketmouse]# tail /mnt/moonstudio/etc/sudoers

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
[root at archlinux rocketmouse]# systemd-nspawn -qD /mnt/moonstudio/ visudo
[root at archlinux rocketmouse]# tail /mnt/moonstudio/etc/sudoers
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
#### systemd-nspawn TEST ####
[root at archlinux rocketmouse]#

If you run an Ubuntu live media, you first might need to install the
package "systemd-container", since this is the Ubuntu package containing
systemd-nspawn.

> How can I get into single user mode?

"How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 / 20.04
/ 18.04

[snip]

Conclusion

You know now what is rescue and emergency modes and how to boot into
those modes in Ubuntu 22.04, 20.04 and 18.04 LTS systems. Like I already
mentioned, the steps provided here will work on many recent Linux
versions that uses Systemd." -
https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/

This is a wrong conclusion. Nothing of this would work on my machine,
since it boots Ubuntu without having GRUB installed. However, this
article explains why there is no single user mode available at all.

Regards,
Ralf




More information about the ubuntu-users mailing list