mount a CIFS share with full RW access
This is the first time I'm trying this. I would like to mount a shared windows network drive on my linux server. following command is doing the job but it is just the read access :
mount -t cifs -o username=myuser,domain=ad009,uid=myuserid,file_mode=0777,dir_mode=0777,gid=1001 //windowsShearedDrive/data/OF /home/myuser/ofIn of folder on my linux running the ls -l returns :
total 4096
-rwxrwxrwx. 1 xxxxxxxx shiny 1933 Dec 18 2015 Archive_OF.lnk
drwxrwxrwx. 2 xxxxxxxx shiny 0 Jan 30 00:34 BEL-00003
drwxrwxrwx. 2 xxxxxxxx shiny 0 Jan 14 2019 BEL-00047
drwxrwxrwx. 2 xxxxxxxx shiny 0 Jan 14 2019 CHN-00707
drwxrwxrwx. 2 xxxxxxxx shiny 0 Mar 20 2015 CHN-00708
...So I am unable to write anything in that mounted drive. Is the problem in the file_mode and dir_mode ?
instead of 0777 I have tried the 0700 for both but still no write access ! and by the way what are the valid options for file_mode and dir_mode ?
The following is my linux os /version info :
cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.5 (Maipo)"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.5"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.5:GA:server"
HOME_URL=""
BUG_REPORT_URL=""
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.5
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.5" 3 1 Answer
Use the rw option to enable read/write access. This would make your command mount -t cifs -o rw,username=myuser,domain=ad009,uid=myuserid,file_mode=0777,dir_mode=0777,gid=1001 //windowsShearedDrive/data/OF /home/myuser/of This should work, assuming your user has write permissions on that samba share.