Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do I get my USB drive to auto-mount as owned by 'me' rather than by whomever is logged in to the computer screen at the time? Often I SSH into my computer while someone else is using it, and so the read-write permissions of devices I mount go to them.

This causes all kinds of permission related problems and there must be a way for USB drives to always mount to a given user.

share|improve this question
    
sorry, i do not understand what you plan. do you want to swich the user who is logged in when a usb drive mounts? –  Dominik Oct 26 '11 at 19:35
    
No, just always mount it automatically as a pre-determined user, not the user that just so happens to control the desktop. –  Mathew Oct 26 '11 at 21:11
    
The USB stick is 'vfat' format. On the shared PC my cat Theodore is logged in and watching something on YouTube. I want to plug my USB stick in, sync my work files and maybe update the USB stick once I have done some more work. I do this on a netbook, ssh'd in to the main, but shared PC. Unfortunately, because user 'theodore' is logged in, the files on the USB stick are 700/500 with owner 'theodore' whereas I would like them to be always user 'mathew' regardless of whom is actually logged in. (My work PC mounts the drive as 'mathew' and I can rsync etc effortlessly). –  Mathew Oct 27 '11 at 8:51
add comment

1 Answer

Review the following forum post on UDEV rules.
http://ubuntuforums.org/showthread.php?t=168221

The key piece of information for your particular scenario would be the OWNER parameter which is not actually documented in the above post, but you can read about it here:
http://www.reactivated.net/writing_udev_rules.html#ownership

share|improve this answer
    
If possible at askubuntu we like to provide the information directly in addition to links because links often go bad (and it's more convenient also). Any chance you could mention how to find the device used by the kernel where flash drives are placed; and an example of a udev rule and file location for, maybe /dev/sdb for owner "mathew"? –  John S Gruber Aug 8 '12 at 17:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.