Home

  • Contact
  • Forum
  • Free Ubuntu E-Books
  • Popular Posts
  • Search
  • Ubuntu Hosting
  • About
  • RSS Feed
  • Sitemap
  • Privacy Policy

Ubuntu Geek

Ubuntu Linux Tutorials,Howtos,Tips & News | Zesty Zapus,Artful Aardvark

Ubuntu Tip:How to disable guest account in ubuntu 12.04(Precise)

Posted on May 10, 2012 by ruchi 23 Comments

By default ubuntu 12.04 comes with guest account.You can disable this account using the following procedure.Guest account is a paswordless account which allow users to get access to Ubuntu machine

Open /etc/lightdm/lightdm.conf file from your terminal using the following command

gksudo gedit /etc/lightdm/lightdm.conf

Add the following line

allow-guest=false

Save and exit the file

After adding the above line you should see similar to the following in lightdm.conf file

[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
allow-guest=false

Finally you have to restart lightdm using the following command from your terminal

sudo restart lightdm

Note:- After executing above command all graphical programs running will be closed (Thanks to sergio)

Sponsored Link

Related posts

  • Zik – Audio player based on gstreamer (3)
  • Zero Install Injector – Install software easily and without root privileges (17)
  • Zenmap – Cross platform Nmap Security Scanner GUI (0)
  • Zattoo – Watch Online TV for free (18)
  • Youker assistant – Integrated tool to aid in routine system maintenance tasks (1)
  • YouAmp – Yet another music player for Linux (10)
  • ÜberStudent – Ubuntu version for Students and Researchers (18)

23 thoughts on “Ubuntu Tip:How to disable guest account in ubuntu 12.04(Precise)”

  1. danrgmc on May 10, 2012 at 3:17 am said:

    You might add to this the fact that there is a bug in lightdm that affects some of us that causes lightdm to ONLY boot to the guest account unless the above action is taken.

  2. Sergio on May 10, 2012 at 3:28 pm said:

    Please add a warning saying that after executing sudo restart lightdm all graphical programs running will be closed.

  3. ruchi on May 10, 2012 at 3:32 pm said:

    Thank you and i have updated in the main article

  4. shejuguru on July 8, 2012 at 1:00 pm said:

    Thanks a lot for this piece of information.

  5. Vishal on July 24, 2012 at 6:29 am said:

    Thanks a lot. I have to do it. Thanks very much.

  6. Kalimuthu on July 31, 2012 at 1:16 pm said:

    Hi,
    I’ve made the changes but guest account is not disabled mean it’s login.

    Thanks,
    –Kalimuthu

  7. Hank22077 on August 4, 2012 at 7:43 pm said:

    Thank you for this. All I really wanted was to prevent my kids from guest login w/o permission. So, I really wanted to just be able to make it like 10.04LTS, where I’d have to be logged in to allow the guest access; but, this works just fine.
    However, if you know how to allow guest access from an admin account please let me know. So far, this is the only option I’ve found. Thanks

  8. Felippe Castro on September 27, 2012 at 6:18 am said:

    Thanks, works fine!

  9. Alberto on October 19, 2012 at 9:44 am said:

    As danrgmc says, there’s a bug in lightdm, it only boot in guest account.
    For writing that file, we need the default root password. Do you know what is the default root password in the prebuilt images?

  10. Francis Massolin on November 15, 2012 at 6:20 am said:

    @Alberto:
    There is nothing as such as a default root password in Ubuntu. The OS was designed to enforce the use of your user account, rather than using root for every admin task. Instead the system relies on SUDO to run any process that requires root privileges. In plain english, it means that to run any process requiring root privileges, you must use the following syntax:

    #sudo + command + commmand’s options
    e.g: sudo apt-get dist-upgrade

    You will then be asked for the admin password, which is in fact your own user account password, the one you’ve created when you installed the system for the first time. That account was automatically added to the admin list in SUDO (/etc/sudoers – don’t mess with this file unless you know exactly what you’re doing!)

    Having said that, sometimes it can be obviously annoying to not being able to log in as root. To do so, you must first ‘activate’ that account, which consist in allocating a password to root :

    #sudo passwd root
    Then enter your new password (a strong one).

    Now the root account is ‘activated’ and you can use the command “su – root” to open a shell session with root.
    Opening a new shell session with “su” is a safer way to use the system than to log on as the root user, something I personally do not recommend.

    Of course, if you make a mistake when using the root account you will feel sorry for yourself…
    With great power comes great responsibilities. ;o)

  11. Pouya on December 21, 2012 at 8:06 am said:

    thanks alot, but i cannot edit lightdm.conf

    i don’t have permission for that 🙁

    what should i do?

  12. Mac on January 13, 2013 at 5:38 am said:

    Thanks.

  13. Diogo on February 9, 2013 at 7:22 pm said:

    Thanks!

  14. Sarthak on May 7, 2013 at 11:55 pm said:

    Copy paste the below lines. It will work.

    [SeatDefaults]
    user-session=ubuntu
    greeter-session=unity-greeter
    allow-guest=false

  15. Eric on October 1, 2013 at 2:03 pm said:

    Maybe you don’t have root acces ?

  16. Eric on October 1, 2013 at 2:03 pm said:

    Thanks for article is useful.

  17. amy1234 on December 12, 2013 at 2:16 am said:

    so can someone please tell me why the last command is on there if this is for Disabling a guest account?! and if there is a way to change it back thanks

  18. amy1234 on December 12, 2013 at 11:58 pm said:

    also when i entered the last command into the terminal it pretty much killed my computer, thanks, i will admit i was being careless but come on why is that in Guest account disabling?!

  19. Mike on March 9, 2014 at 1:10 pm said:

    If you entered into an empty file to enter the suggested setting,

    do this:

    1. Reboot into recovery
    2. mount -o rw,remount /
    3. rm /etc/lightdm/lightdm.conf
    4. reboot

    * Others, if you already had entries in the file, please DO NOT perform these steps, as it may cripple you OS beyond recovery….

  20. Doug on March 20, 2014 at 5:34 am said:

    As amy1234 did, I went throught the process of adding the allow-guest=false to the file and hit save. went to terminal and entered sudo restart lightdm
    I believe I hit enter, and the computer is now on a blank screen with a cursor mark in the top left corner.
    I did a hard reboot, and it went straight to the same blank screen.
    What to do?
    Thanks for any help.
    Doug

  21. alex on March 21, 2014 at 2:32 pm said:

    this command fucked up my ubuntu 13.10
    sudo restart lightdm

    it cant boot anymore
    i used to reinstall it

  22. sachin on July 2, 2014 at 7:39 am said:

    I added false status in lightdm but now I’m not able to restaret system, I mean to say its not getting restart and halting at ubuntu logo. what to do please give some suggestions.

  23. Cristian on June 9, 2016 at 5:11 am said:

    Thanks, it worked just perfectly =D

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

« How to install MATE desktop environment in ubuntu 12.04(precise)/11.10 (Oneiric)
How to install Gimp 2.8 in ubuntu using PPA »

Sponsored Link

    Cheap Web Hosting

Categories

  • Backup
  • Free Books
  • General
  • Monitoring
  • Networking
  • News
  • Package Mgmt
  • Security
  • Server

Sponsored Link

Archives

RSS Feed

subscribe to the ubuntu Geek RSS feed

UbuntuGeek on Twitter

    Follow Us on Twitter

Support UbuntuGeek

Favourite Sites

Debian Admin
DebianHelp
Tuxmachines
  • Contact
  • Forum
  • Free Ubuntu E-Books
  • Popular Posts
  • Search
  • Ubuntu Hosting
  • About
  • RSS Feed
  • Sitemap
  • Privacy Policy
Copyright © 2016 Ubuntugeek - Ubuntu Linux Howtos and Tutorials All Rights Reserved.