LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-21-2010, 11:33 AM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-17.1 with Cinnamon & KDE
Posts: 1,478
Blog Entries: 3

Rep: Reputation: 95
permissions for USB and "media" drives


How do I configure permissions and ownership [aka, access control] for USB and other "media" drives? In general, I want the plain user to have read-write-modify access. For the long haul, I would prefer some sort of config table that says this media gets those access settings on an individual basis.

While on the subject of "media" drives, how do I configure where a drive gets mounted? It appears that the defaults is /media/someString where "someString" is either a generated string or the volume label. Is this accomplished by a script somewhere that I might modify or configure?

I login using my personal, non-root account. When I connect a USB or other "media" drive, the permissions and ownership are such that I cannot use the desktop tools to alter the drive contents. Also, I need to guess where a given drive contents can be found.

~~~ 0;-Dan
 
Old 01-21-2010, 11:53 AM   #2
guard
LQ Newbie
 
Registered: Jul 2009
Location: Minsk, Belarus
Distribution: Gentoo, Ubuntu
Posts: 17

Rep: Reputation: 0
If you use udev+hal (most probably it's so if you use modern out of the box distro), read this thread: http://forums.fedoraforum.org/showthread.php?t=152328
 
Old 01-21-2010, 12:25 PM   #3
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 315

Rep: Reputation: 34
If you login as non root user in the gui , and ain't able to use the gui interface to manage the device, try opening a terminal, change over to root user using sudo and open the browser from terminal window as under :-
nautilus "name of the mounted media"
example :-
nautilus /dev/sdc1 ; for my usb pen drive.

Even gedit "filename on the media" will open the file in rw mode in gui.

hope that helps
nishith
 
Old 01-21-2010, 04:15 PM   #4
kyphi
LQ Newbie
 
Registered: Jun 2009
Location: Australia
Distribution: Ubuntu
Posts: 25

Rep: Reputation: 18
Mounting should be automatic.

To check that you have the necessary privileges, go to System, Administration, Users and Groups. Unlock the screen with your password, single click on your name, single click on Properties. When the Account Properties screen opens, select the User Privileges tab and ensure that "Access external storage devices automatically" is ticked.

As administrator you can set these permissions on an individual basis.
 
Old 01-23-2010, 11:25 PM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-17.1 with Cinnamon & KDE
Posts: 1,478
Blog Entries: 3

Original Poster
Rep: Reputation: 95
... THANKS to all, but ...

Folks, I appreciate all of your comments, but didn't answer the question (blush) that I meant to ask.

Over here I have some USB drive. I want user=joe to have this access and user=mary to have that access. For some other USB drive I want user=joe and user=mary to have different access or no-access to the drive. In a script, this might be nested switch-case statements:
Code:
# pseudo-code
switch (USB drive)
{
  case (drive 'a')
  {
    testUser( 'x' )
  }
  ...
  default( * )
  {
    testUser( 'x' }
  }
  
}
... or something like that.

~~~ 0;-Dan
 
Old 01-24-2010, 01:55 AM   #6
slightlystoopid
Member
 
Registered: Jan 2010
Distribution: Arch, Gentoo, FreeBSD
Posts: 64

Rep: Reputation: 16
I haven't tried this, buuut in Ubuntu you might try:

Giving the usb sticks labels. For an ext# partition, if you didn't set a label, you can do so this way:

sudo tune2fs -L "yolabel" /dev/yousb

For vfat, you can get the current label with:

mlabel -s /dev/yousb

Now configure nautilus not to mount junk:

gconftool-2 -t bool -s /apps/nautilus/preferences/media_automount_open false
gconftool-2 -t bool -s /apps/nautilus/preferences/media_automount false

Now, modify your fstab to look for these labels and not a device, as well as a specific user id. something like, perhaps:

yolabel1 /media/usb type user,noauto,uid=UID1 0 0
yolabel2 /media/usb type user,noauto,uid=UID2 0 0
 
Old 01-24-2010, 09:15 PM   #7
Julyan
LQ Newbie
 
Registered: Feb 2009
Location: Argentina
Posts: 13

Rep: Reputation: 0
As root see which groups are available in /etc/group.
Then (as root) do:
useradd (or adduser) <user> -G <list of groups separated by commas>.
For example:
useradd timmy -G audio,cdrom, ...
This will let user timmy use audio, cdrom, etc.

Hope it helps.
 
Old 01-25-2010, 02:08 AM   #8
guard
LQ Newbie
 
Registered: Jul 2009
Location: Minsk, Belarus
Distribution: Gentoo, Ubuntu
Posts: 17

Rep: Reputation: 0
Dan, I believe that all of these can be done with the HAL configuration, though it might be quite advanced. But the task itself is quite advanced.
 
  


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 to tell Slackware 12.2 to find the "source media" on my USB? linus72 Slackware 26 03-27-2009 08:42 AM
Failure to mount drives. "Cannot obtain lock on /media/.hal-mtab" tolle66 Linux - Newbie 1 01-21-2009 01:09 PM
Where is "Removable Drives and Media" royeo Linux - Newbie 1 08-31-2006 01:44 PM
FC5: "Permissions denied" on windows drives FSoftware Lover Fedora 5 08-31-2006 01:20 AM
rh9 usb officejet g85 "media tray empty" message skippy1969 Linux - Hardware 0 03-03-2004 07:47 PM


All times are GMT -5. The time now is 09:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration