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

11
  • 3
    Logging as root is disabled in Ubuntu anyway. Normal user doesn't have sudo permissions. You can remove the user with sudo permissions as an experiment.
    – Pilot6
    Aug 21, 2019 at 13:39
  • 1
    If a user have physical access to the system, they can boot from a LiveUSB or harm the system other ways. It makes no sense. It is better to have an admin user with a good password.
    – Pilot6
    Aug 21, 2019 at 13:46
  • 2
    Would you call it a harm if someone with physical access to the machine simply overwrite your drive with zeros so that all data and os is gone?
    – mook765
    Aug 21, 2019 at 14:23
  • 1
    You should be still able to use a tty or a launcher (.desktop-file) to run commands which don't need sudo or a script in the home-directory. And i meant what you created at step 1
    – mook765
    Aug 21, 2019 at 15:44
  • 1
    Would a write-locked boot disk that loads a live-cd distribution work for you? If your normal person managed to make changes to the in-memory part of the OS, a simple reboot restores the system to its pristine state.
    – doneal24
    Aug 22, 2019 at 17:23

2 Answers 2

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.

1
  • You can always bypass the single user mode problem by setting the font color and background color to the same value in grub so that the user cannot see what they are doing in grub.
    – mchid
    Aug 24, 2019 at 0:41
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.

Not the answer you're looking for? Browse other questions tagged .