LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   try to secure usb port of system on linux platform. (https://www.linuxquestions.org/questions/linux-software-2/try-to-secure-usb-port-of-system-on-linux-platform-801893/)

mandars 04-13-2010 11:47 PM

try to secure usb port of system on linux platform.
 
hi i want to lock my usb port of system.i am using linux fedora 11 operating system. so for that purpose i want to know or i want the detection code that help to detect any external devices plug in to system.

Sayan Acharjee 04-13-2010 11:58 PM

If you want to disable the usb, you can do it in the follwing way:
Open /etc/modprobe.conf file and turn off auto loading by adding:

Quote:

alias usb_storage off
Then run:
Quote:

#modprobe -r usb_storage

mandars 04-14-2010 12:04 AM

is there any source code for this detection of devices

ddaemonunics 04-14-2010 12:37 AM

some udev rules might help..then you can run a program when certain device is detected

You could for example change ownership or permissions for that device

SUBSYSTEMS=="usb", DRIVERS=="usb",MODE="0600", OWNER="unics", SYMLINK+="usbdevice_%k"
the only usb device that I have is a floppy...

you can be more specific using ATTRS{some identification} ...I guess sky is the limit
you ca use string pattern matching etc etc
using external programs you can log all the usb devices conected, because udev variables can be accessed by external scripts

mandars 04-14-2010 02:22 AM

hi
 
thank u sir ,.
but one question sir if i write external program for this how could i deal with this ?

mandars 04-14-2010 02:40 AM

detection of devices on usb port
 
hi guys,


i m student of fergusson clg (pune)india.
i am doing project on usb port on linux platform.
i want to know hw detection of external devices happen when u plug it thrugh usb port.
i want any code for this detection so i set permission for accesing that device.
will u help me plzzzzzzz.




regards

catkin 04-14-2010 05:16 AM

This is the same question as:That's not nice -- it's against LQ rules for very good reasons like it wastes people's time answering a question that may already have been answered and it makes it harder for people searching later for solutions to a similar problem.

pixellany 04-14-2010 07:34 AM

Please use descriptive titles, and do not say things like "please solve". I put in a better title.
Also, please do not use texting shorthand here---spell out you words and use caps, punctuation, etc.

Have you read up on things like hal and udev? What have you found on Google?
Quote:

i want any code for this detection so i set permission for accesing that device.
What does this mean?

pixellany 04-14-2010 07:56 AM

closed all the duplicates---and merged with the original (closely related) thread
mandars;
Only one thread per topic, please


All times are GMT -5. The time now is 01:15 AM.