Results 1 to 4 of 4

Thread: Automatically run Virus Scan when inserting USB pen drive

  1. #1
    Join Date
    Jun 2009
    Beans
    33

    Automatically run Virus Scan when inserting USB pen drive

    Hi All,

    I use my ubuntu laptop at work and connect a lot of usb pen drives to my computer. Everyone else I work with use windows and I want to make sure that the usb pen drives don't contain any windows viruses so I don't spread them.

    The best way for this to be done would be to have the USB pen drives automatically scanned with they are inserted in my ubuntu machine. Any ideas on how to do this?

  2. #2
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Automatically run Virus Scan when inserting USB pen drive

    You can do this with a udev rule. I have done similar but for changing mount mode to read only. Should be the same idea but with a different run script.

    Here is my rules, you put them in a file in /etc/udev.d/rules/

    KERNEL=="sd[b-z][0-9]", ACTION=="add", RUN+="/usr/local/bin/remounter /dev/%k"
    KERNEL=="mmc*", ACTION=="add", RUN+="/usr/local/bin/remounter /dev/%k"

    For me this runs a script I made called remounter. What these rules say is "when a new kernel device named sdb0 - sdz9 or starting with mmc is added to the system then run this program... with the device name. For more info google "udev rules", there is some how-to pages around.

  3. #3
    Join Date
    Aug 2010
    Location
    Stockport/Manchester, UK
    Beans
    4

    Re: Automatically run Virus Scan when inserting USB pen drive

    Just resurrecting this one to say thanks - looks like exactly what we need.

  4. #4
    Join Date
    Mar 2012
    Beans
    15

    Re: Automatically run Virus Scan when inserting USB pen drive

    me too!
    ah beautiful forums!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •