Howto: Disable the Guest Account in Ubuntu 12.04

by . Originally posted

Ubuntu Guest Lock DownSometimes I’m sure its very useful to have a guest account on your machine, perhaps your partner or friend needs to browse the internet and you’d rather not let them access your account as you’ve got all your code / files / swiss bank accounts open.

Alas, for me the guest account is just an extra addition at the login screen that doesn’t need to be there. So if you want to remove the guest account, please perform the following steps to remove the option in 12.04 Precise Pangolin.

As with any of the code/tweaks I suggest on my site, execute them at your own risk. If you don’t know what the code you’re about to run does, Google it or ask on the Linux forums. I’ll try to explain but I’m no expert and I do make mistakes too.

NB: This works in 12.04 Precise Pangolin, but should also work in 11.10 Oneiric Ocelot as well as future releases due to their use of the LightDM X windows manager used to render the login interface

Removing the Guest Account

  1. First off, save and close all your work, then open your terminal (CTRL+ALT+T),
  2. If you don’t have root priviliedges, execute the following:
    sudo su
  3. Navigate to the LightDM folder, execute:
    cd /etc/lightdm/
  4. Best practice to take a copy of the configuration file before modification:
    cp ./lightdm.conf ./lightdm.conf.original
  5. Open the file in your usual editor, here I’m using gedit:
    gedit ./lightdm.conf
  6. gedit will open the file in its own window, something like the window below should open up:
    gedit LightDM.conf
  7. Append the following line to the bottom of the file before saving:
    allow-guest=false
  8. So you should end up with a LightDM configuration file with the following contents:
    [SeatDefaults]
    user-session=ubuntu
    greeter-session=unity-greeter
    allow-guest=false
  9. Save and close the file,
  10. Restart 12.04 Precise Pangolin / 11.10 Oneiric Ocelot normally or execute the following command:
    /etc/init.d/lightdm restart
  11. Now when you get back to the login screen, the guest account should have disappeared.

If this has helped you out I’d really appreciate a retweet, Google +1 or Facebook Like. Every little bit helps to spread the Ubuntu / Linux knowledge as well as inspire me to write more.

Categories: Computing, Fixes & Solutions, Linux

Tags: , , ,

Leave a Reply

Your email address will not be published.

Links and useful footery things…

Copyright © 2017 Paul Joyce. Follow me on Twitter or perhaps Google+