How To Prevent Someone From Executing xkill

From wikipedia entry:

Xkill is a utility program distributed with the X Window System that instructs the X server to forcefully terminate its connection to a client, thus “killing” the client.

Someone at id-ubuntu mailing list asked how to prevent someone from executing xkill. After reading this, my evil mind popped a solution >:).

My strategy is rather simple, you rename that xkill and move it somewhere else and put a script in place of xkill. Here’s the run down:

  1. rename xkill and move it somewhere else: sudo mv /usr/bin/xkill /etc/init.d/llikx_hide
  2. put a script in place of xkill:
    sudo touch /usr/bin/xkill
    sudo chmod 555 /usr/bin/xkill
    sudo nano /usr/bin/xkill
    

    Put this script:

    #!/bin/bash
    
    logger "I'm trying to execute xkill";//logger will automatically save user who execute logger 
    zenity --info --text "What are you doing?\nxkill execution is locked and logged\!" --title "Operation failed";
    
  3. There you go. Everytime someone trying to execure xkill, they will see popup window.

Author: Arief Bayu Purwanto

Hello, my name is Arief Bayu Purwanto, a 24 years old father of a beautiful daughter. Interested in online programming, linux, games, and reading. Currently working on kapanlagi.com as junior developer. I live in a relatively quite and cool place called Malang. I'm available for some freelance stuff as well as some consulting job. You can see my portofolio for some previous task I've finished and some other information related to my capability. Btw, I'm plurking here.