Directory permissions when mounting Windows shares via fstab

Hello:

I have a Win7 machine with some shares and am using fstab to mount them into my Ubuntu24 directories (mount points.) Here is one relevant entry…

//192.168.1.180/Shire_D /mnt/Shire_D cifs credentials=/home/mark/.SMBwinCredentials, file_mode=0777,dir_mode=0777 0 0

My issue is the permissions keep coming up as drwxr-xr-x
I cannot write to the windows shares from my Linux machine.

After booting ls -l shows…

drwxr-xr-x 2 root root 8192 Mar 23 00:12 Shire_D

If I umount the dir then ls -l shows…

drwxrwxrwx 2 mark mark 4096 May 15 10:06 Shire_D

While mounted doing…

sudo chmod 777 /mnt/Shire_D

reports no error, but has no effect.

Also, I cannot change the owner of the mount point after the Win share is mounted.

In terminal, as a normal user, I cannot copy a file into the Windows share, but if I sudo before the cp command it works OK.

All files and folders in the mountpoint for the Win share are owned by root and have the same limited permissions.

On the windows machine, I check the properties for the drive to be shared, then check the permissions for the share, and the entire drive has full access enabled. Also, I can write to it from other Windows machines.

Please help,

New Information:
{
I found (in Nemo) File->Connect to server.
Using that, it popped up a window asking for credentials, then asked for my password to open my “Keyring” and I can write to the folder in Nemo now.

Also, in terminal, now I can use sudo to copy a file to the Windows share but still can’t change the permissions or write as a normal user. (In retrospect, I may have been able to sudo cp before, I don’t renenber testing that.)

I want to do this to use FFSync and it wants to make a lock file on the Windows share, and that still doesn’t work.
So it only allows writing in Nemo.
}

Thanks, Mark.

Try the following. Note that you will have to change the uid and gid to your own uid/gid (you can also use a username and groupname).

Also note that you have a space in the list of options (which I have removed). Not sure if it matters.

//192.168.1.180/Shire_D /mnt/Shire_D cifs credentials=/home/mark/.SMBwinCredentials,uid=1000,forceuid,gid=1000,forcegid,file_mode=0777,dir_mode=0777 0 0

man fstab and man mount.cifs are useful references.

Mark - I had the same issues, this solved it for me it’s a few lines from my /etc/fstab:
‘’‘UUID=8824FB8124FB7094 /media/newdata ntfs-3g defaults,rw, 0 2
UUID=6C1A9DDB3DACAA1B /media/m2 ntfs-3g defaults,uid=1000,gid=1000,nofail 0 2
UUID=FE4A29264A28DD61 /media/2tba ntfs-3g defaults,uid=1000,gid=1000,nofail 0 2
UUID=F409-FA99 /boot/efi vfat defaults 0 1
UUID=4090AB2A90AB257E /media/films ntfs-3g defaults,uid=1000,gid=1000,nofail 0 2’‘’

The only one I do not require write permissions is newdata, so just the defaults.

Tony