I am participating in an acdemic cyber security competition and I am looking to force students to think outside the box. I am inquiring if there is a way a mouse can be disable and re-inabled on a Linux system.
Sponsored by: █ Sparkhost - Hosting Without Compromises! █ Hybrid Performance Web Hosting █ Spark Host Stream Hosting █ Hybrid IRC & IRCd Server Shell Accounts
Disable Mouse
Started by
seadhead
, Jan 31 2012 01:10 PM
3 replies to this topic
#1
Posted 31 January 2012 - 01:10 PM
#2
Posted 06 February 2012 - 08:21 AM
I will answer my own question. I found you can unload the associated kernel module and render the mouse useless. Example:
# lsmod | grep mouse psmouse # rmmod psmouse # echo bye bye mouse bye bye mouse # locate psmouse.ko /lib/somewhere/psmouse.ko # insmod /lib/somewhere/psmouse.ko # echo mouse is back mouse is back
#3
Posted 21 February 2012 - 06:10 AM
I will answer my own question. I found you can unload the associated kernel module and render the mouse useless. Example:
# lsmod | grep mouse psmouse # rmmod psmouse # echo bye bye mouse bye bye mouse # locate psmouse.ko /lib/somewhere/psmouse.ko # insmod /lib/somewhere/psmouse.ko # echo mouse is back mouse is back
Interesting problem and solution.I've tested it and realized that you may reduce the steps in the script, i.e. instead using
# locate psmouse.ko /lib/somewhere/psmouse.ko # insmod /lib/somewhere/psmouse.ko # echo mouse is back mouse is back
you may simple
# modprobe psmouse # echo mouse is back
#4
Posted 23 April 2012 - 11:34 PM
You can also use the xinput utility.
I made a little script to help you automate this. Just save it as mouse.sh or whatever and run:
Note: This only works on the current X session unless you change the DISPLAY environment variable to the X server you want to control and have disabled access controls on that session. For example:
mouse.sh
I made a little script to help you automate this. Just save it as mouse.sh or whatever and run:
# sh mouse.sh disableor to renable the mouse:
# sh mouse.sh enable
Note: This only works on the current X session unless you change the DISPLAY environment variable to the X server you want to control and have disabled access controls on that session. For example:
x-server # xhost +inet:<your-comp's ip address> your-comp # DISPLAY=<x-server's ip address>:0 sh mouse.sh disable
mouse.sh
#!/bin/bash first_arg=$(echo $1 | tr [:upper:] [:lower:]) case $first_arg in enable ) enable=1 ;; disable ) enable=0 ;; * ) echo "Usage: $0 [enable|disable]"; exit 1 ;; esac ids=$(xinput list | sed -ne 's/.*id=\(\S\+\).*slave\s\+pointer.*/\1/p') for i in $ids; do xinput set-prop $i 'Device Enabled' $enable done
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












