Howto: Disable the Guest Account in Ubuntu 12.04
Sometimes 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
- First off, save and close all your work, then open your terminal (CTRL+ALT+T),
- If you don’t have root priviliedges, execute the following:
- Navigate to the LightDM folder, execute:
- Best practice to take a copy of the configuration file before modification:
cp ./lightdm.conf ./lightdm.conf.original
- Open the file in your usual editor, here I’m using gedit:
- gedit will open the file in its own window, something like the window below should open up:
- Append the following line to the bottom of the file before saving:
- 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
- Save and close the file,
- Restart 12.04 Precise Pangolin / 11.10 Oneiric Ocelot normally or execute the following command:
- 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.