LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-17-2011, 12:42 PM   #1
jason.red
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Exclamation Restricting remote users from accessing removable media


I run a system that users may log into either remotely or physically. Multiple users may be logged in simultaneously because of the remote access, but only one user can be physically logged in at a time.

With the current setup, however, if the physical user inserts a flash drive (which the OS mounts automatically) then the remote users gain access to the removable media.

Is there a way to restrict access to removable media so that only the physical user has access?
 
Old 03-17-2011, 01:16 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Yes, disable auto mount, and just manually mount the drive within your home directory.
 
Old 03-17-2011, 01:24 PM   #3
IgnorantGuru
LQ Newbie
 
Registered: Feb 2011
Location: 11,000 feet
Posts: 14

Rep: Reputation: 12
Quote:
Originally Posted by jason.red View Post
Is there a way to restrict access to removable media so that only the physical user has access?
Once the media is mounted, the normal linux user and group permissions apply. You could change permissions on the mount point, but that generally requires root. You could take a look at my devmon script for automatic mounting, which uses udisks. You could set that to change the permissions on the files after mount. Or another approach would be to only give limited users or groups access to the /media parent dir where the mount points show up.
 
Old 03-17-2011, 10:46 PM   #4
jason.red
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by corp769 View Post
Yes, disable auto mount, and just manually mount the drive within your home directory.
Thanks! That sounds like a good option. However, I would prefer not to give the users mount privileges. Right now, the mount command is restricted to root. Is there a way to give them restricted mount privileges? Perhaps a super user script I could let them run to mount the device for them?
 
Old 03-17-2011, 10:49 PM   #5
jason.red
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by IgnorantGuru View Post
Or another approach would be to only give limited users or groups access to the /media parent dir where the mount points show up.
Great! I'll take a look at your script. As far as this other approach, would there be a way to make these privileges dynamic so that only the user that is locally logged in has access to /media while access is denied to the remote users?
 
Old 03-18-2011, 01:03 AM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
Originally Posted by jason.red View Post
Thanks! That sounds like a good option. However, I would prefer not to give the users mount privileges. Right now, the mount command is restricted to root. Is there a way to give them restricted mount privileges? Perhaps a super user script I could let them run to mount the device for them?
You could always change the file permissions for the mount command
 
Old 03-18-2011, 06:24 AM   #7
IgnorantGuru
LQ Newbie
 
Registered: Feb 2011
Location: 11,000 feet
Posts: 14

Rep: Reputation: 12
Quote:
Originally Posted by jason.red View Post
Great! I'll take a look at your script. As far as this other approach, would there be a way to make these privileges dynamic so that only the user that is locally logged in has access to /media while access is denied to the remote users?
If you mean that whichever user(s) are logged in locally should have mount access, and that those users will change, that would be a little trickier. Probably mounting it in your /home dir would work best for that. Only way I can think of doing that without root would be to write a little daemon script that's always running as root and handles the mounting, but that would take some familiarity with scripting (it could listen to a pipe and take a specific action as root - eg mount to user's home folder - when a user sends a command to the pipe).

Also, I know consolekit has to do with giving specific permissions to locally logged users, but I don't know if that would be useful in this case - probably would be a lot of work to use it, but you could see if there is a polkit permission that pertains to this situation, since you probably already have consolekit active.
 
  


Reply



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
sendmail -- restricting remote auth/login to specific users raminski Linux - Server 0 06-25-2009 10:13 AM
Removable Media zalibidas Slackware 2 01-24-2009 09:09 AM
restricting remote users from a printer tataiermail Linux - Server 0 03-05-2007 06:26 AM
Mounting removable media george_mercury Linux - General 1 07-28-2004 11:14 AM
Problem with accessing removable media kcreagh Linux - Newbie 1 08-04-2003 09:54 PM

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

All times are GMT -5. The time now is 10:35 PM.

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