With this interesting tool you can redirect input over the network – control other Linux boxes as if you were physically sitting in front of them and using a USB mouse and keyboard.
The project’s GitHub repository is found here:
More documentation is available on this site: http://hetgrotebos.org/wiki/uinput-mapper
Here is an introduction how to set up keyboard and mouse forwarding via SSH to a second Linux box.
as user root (sudo su):
aptitude install git-core
This will check out the tool into the /opt directory. This is not a requirement per se, you can also install it in a different directory of your liking.
make will build the file “uinputmapper/uinput_gen.py”
Use the same procedure on the server.
Connect to server
Test the connection by logging in via SSH and the appropriate key to the server (you need to set this private / public authentication up first, of course – see this article, for instance).
Should log you in to the remote server. Change the username, (the path to the key if needed – can be specified with the –i option), and the IP address according to your setup.
Log out again.
Have a look at the input devices on your “local” machine, from which you will be redirecting the input:
ls -alh /dev/input/*
Sometimes, keyboards will create two devices – one for the additional (multimedia?) keys.
Connect (with error / stdin logging)
./input-read -G /dev/input/event0 -G /dev/input/event1 -D | ssh firstname.lastname@example.org “/opt/uinput-mapper/input-create &>>/tmp/errorlog “
If nothing happens, have a look at /tmp/errorlog on your server:
Traceback (most recent call last):
File “/opt/uinput-mapper/input-create”, line 73, in <module>
fd, ev = in_f.load()
Try connecting with the compatibility option for Python < 2.7 in this case.
./input-read -C -G /dev/input/event0 -G /dev/input/event1 -D | ssh email@example.com “/opt/uinput-mapper/input-create -C &>>/tmp/errorlog2 “
please note, that the compatibility flag needs to be given on BOTH sides (local and remote part) of the command.
You can verify your Python version like this:
root@cloudsource2:/opt/uinput-mapper# python –version
If everything works allright, you can leave away the last part (starting with the ampersand “& …”) which just redirects standard output and error from the server for debugging.