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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-21-2010, 10:33 AM
|
#1
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Rep: 
|
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
|
|
|
01-21-2010, 10:53 AM
|
#2
|
LQ Newbie
Registered: Jul 2009
Location: Minsk, Belarus
Distribution: Gentoo, Ubuntu
Posts: 17
Rep:
|
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
|
|
|
01-21-2010, 11:25 AM
|
#3
|
Member
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318
Rep:
|
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
|
|
|
01-21-2010, 03:15 PM
|
#4
|
LQ Newbie
Registered: Jun 2009
Location: Australia
Distribution: Ubuntu
Posts: 25
Rep:
|
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.
|
|
|
01-23-2010, 10:25 PM
|
#5
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Original Poster
Rep: 
|
... 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
|
|
|
01-24-2010, 12:55 AM
|
#6
|
Member
Registered: Jan 2010
Distribution: Arch, Gentoo, FreeBSD
Posts: 64
Rep:
|
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
|
|
|
01-24-2010, 08:15 PM
|
#7
|
LQ Newbie
Registered: Feb 2009
Location: Argentina
Posts: 13
Rep:
|
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.
|
|
|
01-25-2010, 01:08 AM
|
#8
|
LQ Newbie
Registered: Jul 2009
Location: Minsk, Belarus
Distribution: Gentoo, Ubuntu
Posts: 17
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 03:09 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|