1

While I know it's useless in practice as such system won't be usable, can't be fixed, no apps can be installed...etc but I would like to know is it possible to have an OS that has no root at all.

Assuming I use the chroot environment via cubic to do the following:

  • Create a normal user with addusr (without adding it sudo).

  • Modify the user root in /etc/passwd to

    `root:x:0:0:root:/root:/sbin/nologin

  • Remove the first line in /etc/shadow.

  • remove the gnome-terminal

  • Use full disk encryption

This leaving the system with only one non-sudo user.

Will there be any way to run commands, execute .sh scripts, install apps or do any harmful actions? in this case is logging in as root completely impossible?

Thanks in advance

2 Answers2

2

I don't think this is possible if the user has physical access. They can always boot into single user mode, which gives them a root prompt. They could then give any user sudo rights.

mchid
  • 44,904
  • 8
  • 102
  • 162
ianinini
  • 140
1

Will there be any way to run commands, execute .sh scripts, install apps or do any harmful actions?

Yes. See the list below.

in this case is logging in as root completely impossible.

Yes. You do need to do a couple more things.

  1. Encrypt the partitions. That prevents someone taking out the hard disk, cloning it and accessing scripts and data from another machine. Might be optional if all you are interested in that someone can not do it from your machine.
  2. Put up a password for entering bios. Then disable booting from external sources. This disables the ability to boot a live session.
  3. Disable GRUB to show up (ie. grub rescue could be used to get to root). Mind that this does not stop grub from showing a prompt if the boot disk errors out.
Rinzwind
  • 309,379