Friday, February 09, 2007

Refresh default settings on reboot!

All of our students are using a generic "student" account to access their Ubuntu workstations. This isn't a long-term solution; I am planning to get them to authenticate against our corporate directory (an Active Directory server) when I figure it out. In the meantime, however, there are a few issues involved with everyone sharing a generic user account that are kind of annoying.

The vast majority of the time when I get called into a classroom for help it's because some student has modified their desktop to the point that another user can't use it. They've unmounted the locker drive, or they've removed the taskbar, or something like that. Now, this doesn't really happen all that often, the kids are surprisingly responsible about not modifying the desktop to the point where their peers won't be able to use it.

But it does happen, and I've been asked to keep it from happening.

I've decided the best way to do it is to simply have all the default user settings refresh on reboot so if someone DOES make too much of a change, the next student can simply reset the computer and have a fresh Desktop to work with.

At first I thought that removing the /home/student directory and replacing it with an archived copy would be the way to go. However, I'd like to keep from deleting the students' work on reboot (in case, for example, the reason they need to reboot is because they can't get to their locker to save their work).

After some experimenting, and a bit of communion with my local Linux Users' Group via our mailing list, I've settled on a simple way of accomplishing the goal.

First, I've made an exact copy of the default /home/student at /home/student.fresh (sudo cp -a /home/student /home/student.fresh).

Then I've set it up to remove just the settings files from the student account, and replace them with the originals by editing /etc/rc.local and adding these lines in before the exit 0 line:

# These lines replace all the settings for the student account with a fresh copy of the defaults
find /home/student -maxdepth 1 -iname '.?*' -exec rm -rf '{}' \;
find /home/student.fresh -maxdepth 1 -iname '.?*' -exec cp -prf '{}' /home/student \;

It's that simple!


Anytime after this that the student's default settings need to be changed, it be a matter of logging in as student, making the changes, logging back in as administrator so you can sudo rm -rf /home/student.fresh and sudo cp -a /home/student /home/student.fresh again before you restart the computer.

powered by performancing firefox


Anonymous Joe said...

Not sure what version of Ubuntu you have, or if you are even runing gnome. If so, you can also try using a lockdown editor such as Pessulus ( ) to make sure kids don't have the option to change settings that you wouldn't want them to change (remove panel, etc..) Several gnome apps also have additional lockdown gconf options.

7:56:00 PM  
Blogger Simón A. Ruiz said...

I tried Pessulus and it didn't really do much good for me.

As far as I'm concerned, locking down the Desktop isn't a high priority. The only thing that bothered me about the students being able to modify the Desktop is when they modified it beyond the point where the next student sitting there could use it.

I felt this was the most efficient way to go about solving my problem, since I didn't feel like spending a lot of time on it, and the time I spent on Pessulus underwhelmed me.

This simple extra two lines in /etc/rc.local is enough for now. Perhaps in the future we'll look at something more.

Thanks for your comment!

9:28:00 AM  
Anonymous Royce said...

Gconf-editor did wonders for me in this regard. Now students cannot edit their desktop settings.

3:48:00 PM  
Blogger Simón A. Ruiz said...


Oh? What gconf settings did you play with?

6:30:00 PM  

Post a Comment

Links to this post:

Create a Link

<< Home