LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ntfs mount as non-root doesn't work! (https://www.linuxquestions.org/questions/linux-newbie-8/ntfs-mount-as-non-root-doesn%27t-work-4175494388/)

gonny95 02-09-2014 11:23 PM

ntfs mount as non-root doesn't work!
 
I'm using Slackware 14.1 32-bit





In my /etc/fstab
Code:

/dev/sda2        /.1C            ntfs                rw,noauto,user  1  0
/dev/sda5        /.1D            ntfs        rw,noauto,user  1  0
/dev/sdb1        /.2E            ntfs        rw,noauto,user  1  0

And permissions of mount points are:
root :rw
users :rw
others :rw

I made a user like that:

id:guest
initial group:users
additional groups:root vboxusers

I changed initial group several times such as root,vboxusers..anything

However it dosn't work at all

when I try to mount a disk:


Code:

mount /dev/sdb1
Error opening '/dev/sdb1' : Permission denied
Failed to mount '/dev/sdb1' : Permission denied
Please check 'dev/sdb1' and ntfs-3g binary permissions,
and the mounting user ID. More  explanation is provided at
http://tuxera.com/community/ntfs-3g-faq/#unprivileged

Any of your replies will be greatly appreciated

Didier Spaier 02-10-2014 12:11 AM

I think that the answer is in the document quoted at end of your post:
http://tuxera.com/community/ntfs-3g-faq/#unprivileged
It says this:
Quote:

Why have chmod and chown no effect?
By default files on NTFS are owned by root with full access to everyone. To get standard per-file protection you should mount with the “permissions” option. Moreover, if you want the permissions to be interoperable with a specific Windows configuration, you have to map the users.

Why can’t unprivileged users mount block devices? or Why do I get “fusermount: option blkdev is privileged” error?
Unprivileged block device mounts work only if all the below requirements are met:
  1. ntfs-3g is compiled with integrated FUSE support
  2. the ntfs-3g binary is at least version 1.2506
  3. the ntfs-3g binary is set to setuid-root
  4. the user has access right to the volume
  5. the user has access right to the mount point
The root user can make an ntfs-3g binary setuid-root as shown below
chown root $(which ntfs-3g)
chmod 4755 $(which ntfs-3g) In such case the driver will also be able
  • to fix common FUSE kernel module loading problems
  • to create the required but sometimes incorrectly removed or missing FUSE device file
Please note that using setuid-root can result unforeseen privilege escalation and its usage is discouraged. Only the absolutely trusted users must be granted such access. Below is an example how this can be done for users in the ntfsuser group to be able to mount any NTFS volume if they have also the needed volume access rights. chown root.ntfsuser $(which ntfs-3g)
chmod 4750 $(which ntfs-3g) The setuid-root ntfs-3g driver applies the principle of least privilege during its lifetime as a safety measure.

Why don’t the ‘user’ and ‘users’ options work in /etc/fstab?
The ‘mount’ command doesn’t invoke the ntfs-3g binary with the needed privilege after it has checked and approved the user is entitled to mount a given device on a specified mount point, hereby the user can’t open the device he got the approval in /etc/fstab. This is a problem in the ‘mount’ utility.
Solution: Use at least NTFS-3G 1.2506 with setuid-root set and make sure the user has access rights to the volume and mount point.

gonny95 02-10-2014 07:21 AM

I've solved

It was due to permissions

/dev/sdb1 was belong to disk group

so the users must belong to disk group


All times are GMT -5. The time now is 09:26 PM.