1

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.

dessert
  • 39,982
  • 4
    Use the built-in guest accounts. That's exactly what they're made for. – Byte Commander Feb 01 '18 at 16:13
  • That ^ or get a "reborn" card and do this through hardware. – Rinzwind Feb 01 '18 at 16:23
  • @ByteCommander of course, guest accounts don't exist any more since... what... 17.04? Too bad too. – heynnema Feb 01 '18 at 16:51
  • FWIW, fedora still has a similar function, xguest. https://docs-old.fedoraproject.org/en-US/Fedora/12/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html . It may or may not be easier to use Fedora than recreate the wheel on Ubuntu. – Panther Feb 01 '18 at 17:11
  • 1
    Can be re-enabled though... https://askubuntu.com/q/915415/367990 I'm a bit surprised this still seems not to be fixed however. – Byte Commander Feb 01 '18 at 17:15
  • 1
    @ByteCommander - but the guest session is unconfined, which is IMHO, less that ideal. You can follow https://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 01 '18 at 17:24
  • Would it work with a live Ubuntu system (like booted from a DVD disk or USB pendrive)? – sudodus Feb 01 '18 at 18:11
  • ok so my solution is not be possible? with the script at boot who delete and recreate user each time? – simbla79 Feb 02 '18 at 12:54
  • This is what happens, if/when you use the guest session in 16.04 LTS. A guest user account is created and deleted each time, and it is done automatically, so you need not create and install a script :-) – sudodus Feb 06 '18 at 08:29

1 Answers1

1

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,

old-releases.ubuntu.com/releases/xenial

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.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • 1
    Live Ubuntu can be run from the hard drive using grml-rescueboot. See https://help.ubuntu.com/community/Grub2/ISOBoot#grml-rescueboot – user68186 Feb 01 '18 at 19:33
  • Also see https://askubuntu.com/questions/32484/how-to-boot-from-ubuntu-live-usb-with-try-ubuntu-directly – user68186 Feb 01 '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 01 '18 at 19:46