Track keyboard and mouse usage

dfaber deusfaber at gmail.com
Mon Jul 17 16:51:08 EDT 2006


So, how would I access /dev/input/ devices?
Can I just 'cat' them or read in those files?


Diez B. Roggisch wrote:
> skip at pobox.com schrieb:
> >     Diez> You could use the /dev/input/event* devices.
> >
> > On the only Linux system I have available (Mojam's CentOS-based web server),
> > /dev/input/* are readable only by root.  That doesn't seem like it would be
> > very useful to tools like watch unless they were to run suid to root
> > (creating other problems).
>
> You don't need to give it root access. A simple rule for the udev that
> looks like this:
>
> KERNEL=="event[0-9]*",		NAME="input/%k", MODE="0444"
>
>
> will make the devices world readable. While I haven't thought about any
> security implications that might have (and am not especially
> knowledgeable in such things to be honest), I'm convinced it is way less
> likely to introduce any exploitable holes than suid root would.
> 
> Diez




More information about the Python-list mailing list