Removing Guest Session at login in Ubuntu 14.04

I recently installed Ubuntu 14.04 LTS it works fine but I want to remove the guest account login.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo nano /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

Add the following line, save and then close.

allow-guest=false

Reboot, and you’re set.

Edit

Thanks to Gunnar Hjalmarsson

Based on Gunnar Hjalmarsson comment “ubuntu-session was last updated in the middle of March. Try sudo apt-get install –reinstall ubuntu-session” when that is done, the Guest session returns.

After some research, this can be done a different way as well.

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

sudo -H gedit /etc/lightdm/lightdm.conf

If the file exists, then just add the following line:

allow-guest=false

Otherwise copy and paste the following into it:

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

Save the file and exit the editor. Reboot your system, and the changes will remain even after an update to ubuntu-session as mentioned by Gunnar Hjalmarsson’s comment.

Solution 2

To remove guest login :

  1. sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" > /etc/lightdm/lightdm.conf.d/50-no-guest.conf'

  2. This will create a new file in /etc/lightdm/lightdm.conf.d

  3. To get back guest login again remove 50-no-guest.conf

To remove remote login :

  1. sudo sh -c 'printf "[SeatDefaults]\ngreeter-show-remote-login=false\n" >/etc/lightdm/lightdm.conf.d/50-no-remote-login.conf'

  2. This will create a new file in /etc/lightdm/lightdm.conf.d

  3. To get back remote login again remove 50-no-remote-login.conf

Solution 3

Or just add:

greeter-show-remote-login=false

to /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

along with your disable guest line

No need to overcomplicate a very simple fix by creating additional config files besides default, which will inevidably only confuse the OS at some point when the two files conflict, or the default file is erased and one of your two ‘fixes’ gets undone because you didn’t do them together.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply