How to change permissions on mounted windows share?
I changed my /etc/fstab
to:
//server/share /media/share cifs username=msusername,password=mspassword,uid=1000,gid=1000 0 0
Your entry in fstab
is creating the mount point in /mnt
. Using the /mnt
directory should only work if the drive is a local volume rather than a network share or removable device.
Edit your fstab
entry to:
//servername/sharename /media/ussenterprise cifs username=msusername,password=mspassword,umask=002,uid=1000,gid=1000,iocharset=utf8,sec=ntlm 0 0
This assumes that your uid and gid are 1000 which is the first default user and group IDs. Then use:
sudo umount /media/ussenterprise
sudo mkdir /media/ussenterprise
sudo chown user:user /media/ussenterprise
sudo chmod 755 /media/ussenterprise
mount -a
This should mount the share with your user ID and permissions set to read/write.
Try these options:
username=msusername,password=mspassword,iocharset=utf8,sec=ntlm,nosetuids,noperm
(definitions of noperm and nosetuids are found in the mount.cifs manpage)
Also, think about using a credentials file instead of having your name/pw in the clear:
credentials=/home/<user>/.smbcredentials
since fstab can be read by all.