Results 1 to 10 of 12
Okay I am a complete n00b here and have spent the past week trying to google a solution which I just can't seem to find so maybe if someone here ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-07-2010 #1Just Joined!
- Join Date
- Sep 2010
- Posts
- 8
Non-Root User Writing to USB
Okay I am a complete n00b here and have spent the past week trying to google a solution which I just can't seem to find so maybe if someone here can help me then that'll be great.
Basically I have a USB flash drive currently formatted under vfat. I can log in as root and the system automatically picks it up and automounts the drive successfully.
What needs to happen is that a non-root user needs to be able write to this device while root has mounted this device. Due to other program constraints, I can not mount the device using another user so I have to do it with root.
Any suggestions/help would be much appreciated
Thanks in advance
- 09-07-2010 #2
Is this being mounted via automount or via fstab?
If you're mounting via fstab, you basically just need to add some permissions options (because the drive is FAT, it's a bit more complicated to mount). Adding a "umask=0000" option will set the device to be world-readable and world-writable.
I don't know much about automount, but it's probably a similar option.
- 09-07-2010 #3Just Joined!
- Join Date
- Sep 2010
- Posts
- 8
Automount automatically mounts the drive. I do not know how to configure the fstab file. I tried playing with it but afterwards it doesn't even mount anymore so I replaced it with a copy before I played around with it
So should i be editing the fstab file? I can format the drive to ext2 or ext3. Would it help with the required permissions?
- 09-07-2010 #4
Logging in as root is not really recommended. If you need to run system commands that require root access you should use sudo <command>.
Anyways you would change the permissions on the folder mounted for your usb stick (e.g /mnt/usb)
The -R option is recursive in case you have sub-folders under /mnt/usbCode:chown -R user:group /mnt/usb
Although it may not work on a vfat file system.
Cheers
JC
- 09-07-2010 #5Just Joined!
- Join Date
- Sep 2010
- Posts
- 8
- 09-07-2010 #6
- 09-07-2010 #7
Found this in man mount
Maybe you could config automount to use this optionCode:mode=value Set the mode of all files to value & 0777 disregarding the original permissions. Add search permission to directories that have read permission. The value is given in octal.
- 09-07-2010 #8Just Joined!
- Join Date
- Sep 2010
- Posts
- 8
I am a complete n00b with this. So I don't know how :S
But having a quick read the way I understand it (I could be wrong as I don't have the knowledge of you guys), is that it sets all the permissions of the files on the USB to 777. My problem is writing to the USB...not necessarily trying to read from it.
But if you could maybe tell me what I need to type then I could try it in the terminal console and give it a go.
- 09-07-2010 #9
777 is full permissions with read, write and execute for user, user group and others
Have a read of is it will help you understand permissions in Linux
Linux permissions
Moving on
Post your /etc/auto.misc, /etc/auto.master and any other /etc/auto.* files here
JC
- 09-07-2010 #10
One way is editing fstab, you could post relevant line here and we'll help.
Another way is add your user(s) to usb and plugdev groups. Normally, when a USB device is automounted it will have owner root:plugdev, may vary depending on distro.


Reply With Quote

