9 Comments

  1. Good article, thanks!
    Is there a way to set the target via grub? I’d like to have an entry in my grub menu for booting to graphical/multi-user.

  2. To put Ubuntu 19.04 into Runlevel 2 (Terminal):
    sudo systemctl set-default multi-user.target

    To reverse:
    sudo systemctl set-default graphical.target

  3. Is there a way to give a user with minimal permissions just the NON GUI access and the root user will have full GUI access? I basically have an Ubuntu system shared by multiple users. I want to be the root user with full access. On boot, when a non-root user logs in, it should boot to non-GUI version of Ubuntu with my app running. But when I login with my root account, I should have the GUI version boot up. Thank you!

    1. If you have limited the non-root users’ ability to run your applications only, one possible way is to run the system in multi-user target/text mode. For root, after login, you can use startx command to start the X session from the terminal.

    2. Of course you can restrict users from running certain applications, but if you are about to give them a general shell, they may still find a way to circumvent that. What you want is a restricted shell, e.g. add your app to “/etc/shells”, then set it as the shell of any restricted user in “/etc/passwd”. As long as your application doesn’t allow the user to break out of it, you should be fine.

      As for the root user’s graphical environment, set just set your default to multi-user.target, then use startx after login to start your desktop. Disable or uninstall any display managers.

  4. You don’t need to enable targets. At least on my system this produces an error message, and trying to disable one does nothing. Furthermore, since graphical.target depends on multi-user.target, it is active anyway. While in sysv-init, runlevels used to be separate from each other, systemd builds a dependency tree, so one target may include another.

Leave a Reply

Your email address will not be published. Required fields are marked *