Monday, April 25, 2016

Securing Ubuntu 16.04 LTS: Disable Guest Account

Disable Guest Account in Ubuntu 16.04 LTS

LightDM configuration files are located in /usr/share/lightdm and /etc/lightdm. Disabling Guest account can be easily done by adding a rule into one of the two directories. And below I made a change in /etc/lightdm:

First I created a folder inside  lightdm using the command
# sudo mkdir /etc/lightdm/lightdm.conf.d

Secondly I changed the working directory by entering the command
# cd lightdm.conf.d

Thirdly I created a file called '50-no-guest.conf' inside the above directory and add below two lines to the newly created file.
To create the file:
# sudo vi 50-no-guest.conf

Then add below entries to the file
[SeatDefaults]
allow-guest=false


This can be done by the command in a single step.
# sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" > /etc/lightdm/lightdm.conf.d/50-no-guest.conf'

In order to reenable the Guest account, you may use the command.
# sudo rm /etc/lightdm/lightdm.conf.d/50-no-guest.conf

0 comments: