I'm configuring some PCs for a school computer lab and what I want to achieve is that every time I boot the PC the script deletes a student user and recreates it to restore all default setting of the machine.

It is possible to achieve this configuration? I have tried it with a script and partial work until I logoff with the teacher user after that I can see student user and log in correctly with all defaults restored. What I want to do is to have the student user at login.

  • 4
    Use the built-in guest accounts. That's exactly what they're made for. – Byte Commander Feb 1 '18 at 16:13
  • That ^ or get a "reborn" card and do this through hardware. – Rinzwind Feb 1 '18 at 16:23
  • @ByteCommander of course, guest accounts don't exist any more since... what... 17.04? Too bad too. – heynnema Feb 1 '18 at 16:51
  • 1
    Can be re-enabled though... askubuntu.com/q/915415/367990 I'm a bit surprised this still seems not to be fixed however. – Byte Commander Feb 1 '18 at 17:15
  • 1
    @ByteCommander - but the guest session is unconfined, which is IMHO, less that ideal. You can follow bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1742912 for updates, but my impression is it will take some time for Ubuntu to configure the guest session. Using the guest session is fine as long as you understand the risks and the fact it it is unconfined. – Panther Feb 1 '18 at 17:24

Guest session in Ubuntu 16.04 LTS

Install Ubuntu 16.04 LTS from the first point release, 16.04.1. It will stay with the xenial kernel series, now at 4.4.0-112, and will be supported until April 2021. You find the iso file and md5sum at the following link,


There is a working guest session in this version. It is true that it is not as safe as a confined session, but I think it can be good enough for this purpose.

enter image description here

The guest session is temporary. A new guest session is created every time someone logs in to it.

Live Ubuntu

A simple alternative is a live Ubuntu system (typically booted from a DVD disk or USB pendrive). It can be installed into an internal drive, if that would be best, for example with mkusb.

A live system (live-only, not persistent live) will be reset to the original state after reboot or shutdown.

  • 1
    Live Ubuntu can be run from the hard drive using grml-rescueboot. See help.ubuntu.com/community/Grub2/ISOBoot#grml-rescueboot – user68186 Feb 1 '18 at 19:33
  • Also see askubuntu.com/questions/32484/… – user68186 Feb 1 '18 at 19:45
  • 2
    @user68186, Yes there are several ways to boot/run live Ubuntu from the hard disk drive. It is also important for the OP, simbla79, to decide if it should be possible to write files to the drive, and how to get a such a system. (I think these things are easier to fix with the guest session in an installed system.) – sudodus Feb 1 '18 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.