LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 10:33 AM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
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, 10: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, 11:25 AM   #3
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

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, 03: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, 10:25 PM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
... 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, 12: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, 08: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, 01: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:50 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