Ubuntu – Samba network sharing NTFS drives and root permissions from local drives

11.04permissionssamba

I'm able to share my internal 2ndry NTFS drives (sdb1,2 and 3) on the network with Windows computers now but even though Samba read/write is enabled, Windows network computers can only open files "read-only" and can't save files to the samba shared drives/folders.

I try to set permissions in Ubuntu via folder and/or file properties even logged in root via Nautilus but all the samba shared folders and files are set as owner = root, accessible and does not allow me to change them to read/write, it just resets to root, accessible, in other words, I can't change permissions.

I'm running Ubuntu 11.04 Gnome on an old Dell Dimension 2400.

Also, in order to for me to copy or move any files from the Ubuntu drive to the sdb1,2 or 3 drives, I have to gksu nautilus. This consequently prevents me from copying .ISO files to my "Multisys" thumb drive too.

Best Answer

Normally in these cases the permissions are set at mount time, since NTFS can't store unix permissions, to do so use something like this:

mount /dev/sdb1 /media/mydisk -o uid=youruser,gid=users

If you add these other two options to mount fmask=664,dmask=775, everyone in the users group will effectively be able to write to that file system. You can also use /etc/fstab if you want to mount the disk at boot time, the format is slightly different but the options are the same. Keep in mind that using NTFS in this specific case does have limitations compared to using EXT3/4, XFS, etc.

More info here man mount.ntfs-3g.