How to prevent cleaner from hanging my lock screen in Ubuntu 16.04

In my workplace I'm using Ubuntu 16.04 with unity, standard installation. When I leave my office I lock my screen (ctrl+alt+l). During the evening, the office is cleaned. A few times, I've got back to work in the morning and my headphones are on my keyboard. My lock screen is hung, I can't clear password field, can't type anything, and can't use any other controls on lock screen (reboot, turn off button etc.). The mouse is working but clicking does nothing. Probably this is because the password field took huge input overnight and broke everything else. The cleaner "hacked" my computer :)

How can I prevent this? Can I somehow limit how many characters can be passed to the password input? Can I block the lock screen until I use some key combination to enable password input? Something similar to ctrl+alt+del in Windows before I can input password to lock screen?

//EDIT As @bytecommander wrote there was a bug for this and it is supposed to be fixed but somehow this does not work on my machine Cat causes login screen to hang

$ apt policy unity-greeter                                                                                                                                            
unity-greeter:
  Installed: 16.04.2-0ubuntu1
  Candidate: 16.04.2-0ubuntu1
  Version table:
 *** 16.04.2-0ubuntu1 500
        500 http://pl.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

// EDIT 2

Someone wrote that lock screen is not unity greeter package. Anyone can confirm this and tell me what package is this?

// EDIT 3

OK so it seems that lock screen is part of Unity and not greeter package. I filled a bug report for this: Lock screen frozen after big input from keyboard


Solution 1:

Seems like your cleaner has successfully managed to emulate a cat.

https://bugs.launchpad.net/ubuntu/+source/unity-greeter/+bug/1538615

There was a bug in unity-greeter in 14.04 and up to 16.04, which caused the lock screen to become unresponsive when there has been excessive keyboard input for some time (figuratively and literally a "cat on the keyboard").

It should be fixed since unity-greeter version 16.04.2-0ubuntu1 though by implementing a character limit. Please check your installed version with

apt policy unity-greeter

and make sure your system is fully updated with

sudo apt update ; sudo apt upgrade

Solution 2:

You can install xtrlock:

$ sudo apt-get install xtrlock

And made a combination for lock screen and lock keyboard, until you press the combination again. Make it hard and then the cleaner have a hard chance to hit and "hack" your computer.

Solution 3:

Another solution is to buy a wireless keyboard, then stash the keyboard in a drawer before leaving, or taking out the USB dongle.

Pros: no need to install any software or mess with settings.
Cons: cost a bit of money, requires extra action before leaving.