Go to file
mrbesen 065352136d
fixed errors
2019-01-19 19:11:34 +01:00
build Updated docs. 2016-02-10 12:36:52 -05:00
docs Clarified instructions for contributing keymaps. 2016-02-12 08:21:13 -05:00
keymaps Update Italian keymap (thanks @gnaomo) 2018-04-19 10:51:22 +02:00
man Added flag to run in foreground, no daemon (--no-daemon switch) 2016-08-17 20:11:14 -03:00
scripts Cleaned up build autotools and docs. 2016-02-10 23:38:21 -05:00
src fixed errors 2019-01-19 19:11:34 +01:00
.gitignore Cleaned up build autotools and docs. 2016-02-10 23:38:21 -05:00
.travis.yml Add .travis.yml 2016-07-31 18:11:50 +02:00
COPYING Implemented HTTP log POSTing and IRC posting, which is undocumented as it doesn't work. This is also a 0.1.1a release. 2010-05-31 21:31:50 +00:00
ChangeLog Hopefully final in a serie of minor doc-related updates in this "iteration." 2010-06-04 17:26:47 +00:00
INSTALL installation on redhat/fedora/centos 2019-01-03 17:27:18 +01:00
Makefile.am Distribution archive didn't contain all source files, now fixed. 2010-05-31 21:47:08 +00:00
README.md Fixed markdown only. 2016-02-12 08:20:50 -05:00
TODO Clarified instructions for contributing keymaps. 2016-02-12 08:21:13 -05:00
autogen.sh Cleaned up build autotools and docs. 2016-02-10 23:38:21 -05:00
configure.ac Updated code to refer to GitHub project. 2016-02-10 12:37:29 -05:00
depcomp Initial v0.1.0 public commit. Everything works. :) 2009-12-13 10:56:57 +00:00
install-sh Initial v0.1.0 public commit. Everything works. :) 2009-12-13 10:56:57 +00:00
missing Initial v0.1.0 public commit. Everything works. :) 2009-12-13 10:56:57 +00:00


logkeys - a GNU/Linux keylogger

logkeys is a linux keylogger. It is no more advanced than other available linux keyloggers, notably lkl and uberkey, but is a bit newer, more up to date, it doesn't unreliably repeat keys and it shouldn't crash your X. All in all, it just seems to work. It relies on event interface of the Linux input subsystem. Once completely set, it logs all common character and function keys, while also being fully aware of Shift and AltGr key modifiers.


See INSTALL for installation/build notes.

Usage how-to

Abuse the output of this software wisely.

logkeys is simple. You can either invoke it directly, by typing full command line, or use the provided scripts. There are two helper programs in this package:

  • bin/llk, which is intended to start the logkeys daemon, and
  • bin/llkk, which is intended to kill it.

bin/llk runs etc/logkeys-start.sh, and bin/llkk runs etc/logkeys-kill.sh.

You can use these two setuid root programs (llk and llkk) for starting and stopping the keylogger quickly and covertly. You can modify the .sh scripts as you like. As the two programs are installed with setuid bit set, the root password need not be provided at their runtime.

Default log file is /var/log/logkeys.log and is not readable by others.

I suggest you first test the program manually with

$ touch test.log
$ logkeys --start --output test.log

and in the other terminal follow it with

$ tail --follow test.log

and see if the pressed keys match to those noted. If you use a US keyboard layout, use -u switch. Make sure your terminal character locale is set to UTF-8

$ locale

or alternatively, you need en_US.UTF-8 locale available on your system

$ locale -a

otherwise you may only see odd characters (like ꑶ etc.) when pressing character keys.

logkeys acts as a daemon, and you stop the running logger process with $ logkeys --kill, or use the bin/llkk script.


For more information about logkeys log file format, logkeys keymap format, and command line arguments, read the application manual, $ man logkeys, or read the documentation.


empty log file or 'Error opening input event device'

After you run logkeys successfully, if you open the log file and see only the 'Logging started...' and 'Logging stopped...' tag without any keypress "contents," it is very likely that logkeys got your device id wrong.

This may also apply if you get the following error: Error opening input event device '/dev/input/event-1'

The solution is to determine the correct event device id, and then run logkeys with --device (-d) switch, specifying that device manually.

The procedure for manually learning the device id to use is as follows:

As root, for each existing device eventX in /dev/input/, where X is a number between 0 and 31 inclusively, write:

$ cat /dev/input/eventX

then type some arbitrary characters. If you see any output, that is the device to be used. If you don't see any output, press Ctrl+C and continue with the next device.

If this happened to be your issue, please submit a bug report, attaching your /proc/bus/input/devices file as well as and specifying which was the correct id.

logkeys outputs wrong characters

It is very likely that you will see only some characters recognized, without any hope for Shift and AltGr working even slightly correct, especially when starting logkeys in X. In that case it is better to switch to virtual terminal, e.g. tty4 (Ctrl+Alt+F4), and there execute:

$ logkeys --export-keymap my_lang.keymap

Then open my_lang.keymap in UTF-8 enabled text editor and manually repair any missing or incorrectly determined mappings. From then on, execute logkeys by

$ logkeys --start --keymap my_lang.keymap

Again, see if it now works correctly (character keys appear correct when you are viewing the log file in editor), and opt to modify bin/llk starter script.

If you create full and completely valid keymap for your particular language, please attach it to a new issue.

Further information

Read the man page. Please read the whole man page. Thanks. :-)

Refer to troubleshooting and FAQ sections in the docs, for currently known issues, ways to resolve them, and any other information.

Report any bugs and request reasonable features on the issues list. When opening new issues, always provide a good summary and description.


You are more than welcome to implement unreasonable features yourself, as well as hack the program to your liking.

If you have suggestions, or are a pr0 and can answer any of the questions in the source, please contribute:

  1. Fork this project
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


logkeys is dual licensed under the terms of either GNU GPLv3 or later, or WTFPLv2 or later. It is entirely your choice! See COPYING for further information about licensing.