When you first look at this question and its title you are going to assume that I want this for malicious purposes, however that is not the case, it is because I type a lot of things, and sometimes (rather often actually) I just want to check what I did, say, half an hour ago, or make sure that I didn't just make a big mistake, however there is no real history of what I type so this becomes rather difficult.
Another reason for this might be that my computer is running certain tasks which should not be interrupted until complete, so I can't suspend my machine, but I would like to be able to come back and tell if anybody typed anything (because most often this is a CLI only session so I don't need to worry about the mouse and I can use other software such as screen recording for that), or executed any keyboard shortcuts.

So, long story short, I would like a "keylogger" however I do not want to install one from anywhere as I don't trust that there aren't any backdoors or anything, so what I would like is a script (and I know that this sort of thing is possible) which:

  • Is able to record (probably in a text file) keystrokes and also when the pressing of a key once results in the character coming out more than once

  • Is able to tell apart keyboard shortcuts from normal typing and also show what the result of the keyboard shortcut was

  • Works in the GUI and CLI

  • Works on Ubuntu GNOME 15.10 with GNOME 3.18 (my system)

  • Preferably written in a language such as bash

  • Only keeps a log of the last 5 minutes (though this should be a variable time which can be easily changed in the code)

  • 3
    There is one in the repositories. You do not trust our repositories? Then the world is doomed. I would not trust software that "which can be easily changed in the code)" .... that should be in a configfile (insert angry face) – Rinzwind Jan 26 '16 at 15:37
  • 2
    Oh and manpages.ubuntu.com/manpages/trusty/man8/logkeys.8.html has a hint: " It relies on the event interface of Linux input subsystem (normally devices /dev/input/eventX)." – Rinzwind Jan 26 '16 at 15:40
  • @Rinzwind: The universe repository is not really checked in-terms of security stuff by the Ubuntu Security Team so I don't really trust it so much, especially with this kind of thing... – user364819 Jan 26 '16 at 15:45
  • 1
    But... you could download the source and peak in that without installing it. Oh and I believe logkeys has no backdoors. I've seen the code a year or so ago since I was curious too ;-) – Rinzwind Jan 26 '16 at 15:46
  • Really, your nickname seems to be great for you! You can read the source code and then compile. Also check the readme for assembly backdoor code. 😉 – Helio Apr 5 '16 at 9:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.