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

  • 7
    Power it down, take it home with you, unplug the keyboard if it's not a laptop, tell hr, AFAIR there's not much you can do security wise once someone physically gets a hold of your machine
    – j-money
    Feb 28, 2019 at 9:07
  • 6
    @j-money I don't think the lady attempts to hack the machine but rather think she just thoroughly cleans the keyboard thereby pressing all the keys. A dust cover and/or this note might help.
    – PerlDuck
    Feb 28, 2019 at 9:45
  • 1
    @PerlDuck maybe that's what she wants you to think!! (couldn't resist)
    – j-money
    Feb 28, 2019 at 9:49
  • 7
    Unplug the keyboard :)
    – Sauce
    Feb 28, 2019 at 10:46
  • 3
    Why not just put the headphones in a drawer before going home? Or hang them over the monitor? Feb 28, 2019 at 14:38

4 Answers 4


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


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
  • 1
    I have version with fix: apt policy unity-greeter unity-greeter: Installed: 16.04.2-0ubuntu1 Candidate: 16.04.2-0ubuntu1 Version table: *** 16.04.2-0ubuntu1 500 and apparently it is not fixed...
    – piotrekkr
    Feb 28, 2019 at 9:27
  • 5
    In that case I think you should (re)open a bug ticket :(
    – Byte Commander
    Feb 28, 2019 at 10:59
  • @ByteCommander I wrote comment in this ticket but I can't find option to reopen it :/
    – piotrekkr
    Feb 28, 2019 at 13:44
  • 1
    The lock screen in Unity is not the Unity Greeter, so any fix to the Unity Greeter package is not going to fix a problem in the Unity lock screen. Feb 28, 2019 at 17:48
  • @StephenM.Webb so what is unity lock screen then? What package?
    – piotrekkr
    Feb 28, 2019 at 17:59

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.

  • 1
    This looks like the answer (short of removing the headphones, of course) Feb 28, 2019 at 14:37
  • @Santi Will this automatically work when I lock my screen using ctrl+alt+l? I read a little about it and it seem to work same way as lock screen you type password and [enter] to unlock. Is it protected from headphones on keyboard or cats? :)
    – piotrekkr
    Feb 28, 2019 at 20:26
  • @piotrekkr yep absolutely it works the same way, just bind both together, tell me how it's going
    – Santi
    Feb 28, 2019 at 21:22
  • @Santi Ok. I'm wondering how should I combine them? If I use lock screen first then I'm locked and normal shortcut keys does not work. If I use only xtrlock then I have locked keyboard and can't lock screen normally (ctrl+alt+l). Did you mean to use only xtrlock?
    – piotrekkr
    Feb 28, 2019 at 21:37
  • @piotrekkr Yes, using only xtrlock you can set a custom shortcut to execute both, I mean, the lockscreen and lock keyboard until you press again the combination. This is an example of how it works example of lock mouse and keyboard but not screen
    – Santi
    Feb 28, 2019 at 21:43

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.

  • 2
    Or a wired keyboard that you can just unplug at night. Plenty of decent keyboards have a USB jack at both ends so you can unplug the cable at the keyboard (rather than having to fish behind the back panel connectors).
    – J...
    Feb 28, 2019 at 14:13
  • @J... oh, never seen a keyboard with USB jack on both ends, but yeah, guess in some places it might be available. Still, that would leave an orphan cord lying around at night. ;) Feb 28, 2019 at 14:17
  • 2
    @J...: And many machines (I'm tempted to say any decent one these days) have USB jacks on the front, and in the monitor(s). But unless there's an actual need for remote access during the night, the sensible course is simply to to turn the machine off when you leave.
    – jamesqf
    Feb 28, 2019 at 18:41
  • 1
    As an alternative, you can get a plain-jane KVM switch for pretty cheap; just switch channels when you leave. Benefit there is you won't be adding wear and tear to your USB port/plug, just press a button.
    – helrich
    Mar 1, 2019 at 18:12
  • 1
    @Shadow Wizard: If it takes 15 minutes to boot your computer, you have something seriously wrong.
    – jamesqf
    Mar 1, 2019 at 18:36

Think inside the box! ;)

Just fabricate a cardboard (or use a more durable material) box that encloses your keyboard (and mouse, if necessary) and put the keyboard in it when you leave. The cords, if any, can pass through open slots in the side of the box to make it easy to use without disconnecting anything.

It's pretty unlikely that the cleaner will deliberately open the box to clean the keyboard. You could add a simple lock if necessary. Just make it in such a way that your employer can get to the keyboard if necessary when you're not there. Using cardboard might help with that.

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