How to Remove Guest Session and Remote Login from Ubuntu.

By default Ubuntu 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

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

$ gksudo gedit /etc/lightdm/lightdm.conf

2. Add the following line

allow-guest=false
greeter-show-remote-login=false

3. 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
greeter-show-remote-login=false

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

$ sudo restart lightdm

5. Restart now your computer.

Note:

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

– Ubuntu 13.10 changed the location of the necessary file from the 13.04 and earlier /etc/lightdm/lightdm.conf
for Ubuntu 13.10, type:

$ gksudo gedit /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf

 

Enjoy!