LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-18-2016, 03:45 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Limit devices in Linux.


Hello.
I use Debian 8.6 amd64 and I like to know how can I limit my Linux for use devices? For example, no one can attach a USB storage or other devices. I mean is something like Windows OS policy. Please look at:
http://woshub.com/how-to-disable-usb...-group-policy/

Thank you.
 
Old 12-18-2016, 09:50 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
The simplest way to do it would be using traditional ownership and permissions. Find out what device file corresponds to each usb socket and set the world rights to none. Then only root can use it.

If you want some users to be able to use the device, assign it to a group that you have created, give the group appropriate rights and add those users to the group.

In any case, storage devices can't be used without being mounted, and only root can mount such a device if it's not listed in /etc/fstab as user-mountable.
 
Old 12-18-2016, 10:04 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by hack3rcon View Post
Hello.
I use Debian 8.6 amd64 and I like to know how can I limit my Linux for use devices? For example, no one can attach a USB storage or other devices. I mean is something like Windows OS policy. Please look at:
http://woshub.com/how-to-disable-usb...-group-policy/

Thank you.
You can look at the udev rules used when identifying devices and adding them to the /dev filesystem.

You can even disable things like USB storage permanently, yet still allow keyboard/mouse connections.
 
Old 12-18-2016, 10:42 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
The advantage of using udev rules is that you can make usage permissions independent of where the device is actually plugged in. A udev rule can identify a device by its vendor and product ID and then set its ownership and permissions accordingly.

The trouble with udev rules is that there is a steep learning curve for actually writing them. And of course the vendor/product thing won't work for unknown devices that users may carry in their pockets.
 
Old 12-18-2016, 12:33 PM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
blacklist the driver?
but idk, there's also internal usb devices, one wouldn't want to disable them.
however, drivers can be configured, too. that's where i'd look first.
 
Old 12-18-2016, 12:34 PM   #6
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
How can I use "udev"? Can you show me some examples?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How will linux bypass the secure boot feature in devices windows 8 devices ??? ylang Linux - General 12 09-20-2012 10:24 AM
pam_limits(sudo:session): wrong limit value 'unlimited' for limit type 'soft' pankajd Linux - Software 3 12-28-2010 09:59 PM
Is there a block limit on scsi_tape (DLT) devices? shaglund Linux - Hardware 0 06-28-2006 03:51 AM
how do I get around the 2TB limit on disk devices? humbletech99 Linux - Hardware 4 06-17-2006 05:00 PM
Quota issue, hard limit doesn't limit users Gratz Linux - Software 2 09-16-2003 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration