Open the configuration file for the LightDM display manager in a text editor, which is used by default for Ubuntu and Xubuntu distributions:
sudo nano /etc/lightdm/lightdm.conf
We find the variable “allow-guest” and change its value from true to false. If it is not there, then add allow-guest=false at the end of the file.
Restart LightDM for the changes to take effect:
sudo restart lightdm
Done, now you cannot log in under the guest account.