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.

I want to grant permission one specific standard Ubuntu 11.10 user to be able to mount a specific NTFS drive. How can I do that?

share|improve this question
    
Is this only a specific user, i.e you don't want any other users on the system to mount that specific device? –  invert Feb 21 '12 at 13:30
    
@Wesley, right. only 1 drive for only 1 user. –  Donotalo Feb 21 '12 at 14:24

2 Answers 2

up vote 7 down vote accepted

You could create a command line to mount the partition into a script, than grant that user the privilege to run the script with sudo. For example

#!/bin/sh
# Filename: /usr/local/bin/mount-win

mount -o uid=john,gid=john /dev/sda1 /media/win

then

sudo chmod +x /usr/local/bin/mount-win

in /etc/sudoers add the line

john ALL = NOPASSWD: /usr/local/bin/mount-win

where john is the standard user's username.

For ease of use, you can create a launcher for the script with a line

Exec=gksu /usr/local/bin/mount-win
share|improve this answer
    
Nice solution, I like this. –  invert Feb 21 '12 at 15:00
    
the first command: sudo mount -o uid=john,gid=john /dev/sda1 /media/win, causes error: fuse: failed to access mountpoint /media/win: No such file or directory. what's going on? /dev/sda1 exists, and i replaced john with real user name. i ran the command from admin user terminal. –  Donotalo Feb 22 '12 at 2:38
    
@Donotalo: /media/win is just an example mount point, you should create a directory under /media and use that. –  enzotib Feb 22 '12 at 8:01
    
ok, now i'm getting Sorry, user john is not allowed to execute '/bin/mount -o uid=john,gid=john /dev/sda5 /media/john-d' as root on Cyanide. when i execute the script from the user's account. now what? –  Donotalo Feb 22 '12 at 13:03
    
@Donotalo: sorry, the script should be called with sudo (or gksu), and the sudo inside the script should be removed. I edited the answer accordingly. –  enzotib Feb 22 '12 at 16:01

You can limit disk use per user or group via disk quotas. This involves enabling quotas per disk within fstab, and configuring quotas with the tools linked.

Also see this article on setting up disk quotas.

share|improve this answer
    
it's not quota i need to set. i've a NTFS partition, which i want only one standard user will be able to mount. i want to set this permission. the user can use the partition in any way s/he likes. –  Donotalo Feb 21 '12 at 14:31

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.