Disclaimer: Everything described below is for educational purposes only. Using keyloggers to spy on others is illegal and unethical.
Keylogging is the process of recording every keystroke made on a computer keyboard. There are two types of keyloggers:
→ Hardware keyloggers – devices that are physically placed between the keyboard and the computer to intercept signals.
→ Software keyloggers – programs that run within the operating system. LogKeys is one of them.
LogKeys is a free and open-source keylogger for Linux. It captures everything you type on your keyboard. It runs reliably on most Linux distributions and doesn’t crash the graphical interface.
It correctly handles modifier keys like Shift and Alt and supports both USB and older serial (COM) keyboards. Even though LogKeys hasn't been actively developed since 2019, it’s still considered one of the most stable tools of its kind for Linux.
If you’ve installed software from source before, setting up LogKeys should be straightforward. If not, you’ll first need to install some essential development tools like a C++ compiler and required libraries.
Installing Dependencies
Commands vary depending on your Linux distro. For Debian-based systems, use:
sudo apt update
sudo apt install build-essential autotools-dev autoconf kbd
Option 1 – Using wget:
wget https://github.com/kernc/logkeys/archive/master.zip
unzip master.zip
cd logkeys-master/
Option 2 – Using Git:
git clone https://github.com/kernc/logkeys.git
cd logkeys
Then run:
./autogen.sh
cd build
../configure
make
sudo make install
If you have issues with keyboard layout or character display, try:
sudo locale-gen
Start Logging
sudo logkeys --start
This starts recording keystrokes. It runs in the background, saving logs to /var/log/logkeys.log by default.
Stop Logging
sudo logkeys --kill
Use this command to stop LogKeys and release system resources.
Help and Options
logkeys --help
Useful flags include:
→ --start – start logging
→ --kill – stop logging
→ --output <file> – set a custom path for the log file
→ --no-control-keys – skip special keys like Ctrl+C, Backspace, etc.
View the Log File
sudo cat /var/log/logkeys.log
To remove LogKeys completely:
cd build
sudo make uninstall
LogKeys is a powerful tool that can be used for testing, security learning, or personal monitoring. But using it without someone’s consent is prohibited. Always follow ethical guidelines and comply with the law.