Root access from bootable iso?

I'll preface this by saying I don't do stupid things on my main PCs but I do have a machine that I experiment with.

After doing a fresh minimal install of 24.04 on an old macbook air (no dual boot) I went to disable guest login by making a change in the lightdm.conf file and now the computer won't boot it just sits at the opening screen with mate logo.

After booting with the usb stick I used to install I can access the file and see what I did but I need root access (permission) to change what I did and this I do not know how to do.
It's not really all that important as I could just re-install but I'd like to learn from my mistake instead of taking the easy way out.

when you made a change in /etc/lightdm/lightdm.conf it implies you used sudo and your pw. You could boot your pc, press ESC to get to the grub page, select recovery and drop to a root shell and modify that file again.

4 Likes

I'm in a root shell but I don't have permission to access the file. Is there a specific command/way to get access to the needed file?

-rw-r--r-- 1 root root 108 Oct 27 2022 /etc/lightdm/lightdm.conf

how is it possible you cannot mod the file as root?

default contents of that file (**user** is your username):

[Seat:*]
autologin-guest=false
autologin-user=**user**
autologin-user-timeout=0
1 Like

if you boot from a live usb, your filesystem is not mounted. The live usb has a boot-repair option. Fix your boot, then mod that file. If you feel adventurous ...

sudo mount /dev/sda2 /mnt (your root partition).
sudo mount /dev/sda1 /mnt/boot/efi (your EFI partition, if UEFI).

Bind Mount:
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

Chroot:
sudo chroot /mnt

Repair/Reinstall GRUB:

grub-install /dev/sda (your disk, not partition).

update-grub

1 Like

All set just needed to use sudo nano /etc/lightdm/lightdm.conf when in root shell.

2 Likes

To get rid of guest login this was the easiest way:

Uninstall arctica-greeter-guest-session. Synaptic is the easiest way to do it.

2 Likes