Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I recently installed the Ubuntu 14.04 LTS it works fine but i want to remove the guest session at the login. I want to know how to remove the guest session in ubuntu 14.04 LTS version.

Thanks in advance

share|improve this question

marked as duplicate by Florian Diesch, Eric Carvalho, Warren Hill, Sneetsher, Mitch Jun 30 at 10:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
What made you think that lightdm is not in use in 14.04? (It is.) –  Gunnar Hjalmarsson Apr 20 at 19:17
    
@Florian Diesch,@Eric Carvalho,@Warren Hill,@Sneetsher,@Mitch,@ Gunnar Hjalmarsson - by that time when i asked this question i searched the web and found Ubuntu 14.04 LTS does not use lightdm to handle logins instead it uses Unity 8 saying its some new feature for ubuntu 14.04 LTS version (found it false later) as i am new to ubuntu that time i dont know about lightdm or login handling. So i posted a new question for Ubuntu 14.04 LTS version. –  Sudheer Jul 2 at 12:15

3 Answers 3

up vote 25 down vote accepted

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 close.

allow-guest=false

Reboot, and you're set.

enter image description here

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 gedit /etc/lightdm/lightdm.conf

If the file exist, 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.

share|improve this answer
    
thank you for your help it worked –  Sudheer Apr 21 at 4:06
    
it worked!!! thank you very much –  Sriranga Apr 30 at 11:06
1  
Thanks you. It worked. I thinks Ubuntu should have a GUI for disable/enable guest user. –  PhatHV May 6 at 5:02
    
echo "allow-guest=false" |sudo tee -a /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf –  Aquarius Power May 29 at 22:50
    
Editing package files under /usr/share is a bad idea, since such changes get lost at upgrades. (50-ubuntu.conf belongs to package ubuntu-session.) Create a new file instead, as suggested in the answer by mnstalemate. –  Gunnar Hjalmarsson Jun 6 at 14:13

To remove guest login :

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

  2. This will create a new file in /usr/share/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" >/usr/share/lightdm/lightdm.conf.d/50-no-remote-login.conf'

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

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

share|improve this answer
    
thank you for your help it worked –  Sudheer Apr 21 at 4:06
    
This is the best method and should be the accepted answer. –  Andrew Aug 29 at 17:47
    
best answer imho - remind me to scroll down first in the future –  Cookie Sep 4 at 6:36

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.

share|improve this answer
    
Can you also include the disable guest line? –  jmunsch Jun 22 at 17:53
2  
You are wrong. Creating additional config files is the way to go. Editing a package owned file under /usr/share will only work until next time the package is upgraded. –  Gunnar Hjalmarsson Jul 2 at 14:04
    
Agree that multiple config files are the way to go, as it is more extensible and causes less conflicts... also easier to automate with devops scripts! –  Asfand Yar Qazi Aug 17 at 4:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.