1. 程式人生 > >mount.cifs Windows共享目錄權限755問題

mount.cifs Windows共享目錄權限755問題

mount cifs

針對CentOS 6.5系統。


通過linux 的mount命令掛載windows下的共享目錄,掛載後目錄權限為755,普通用戶沒有權限寫入。



可以通過file_mode 和dir_mode 來設置權限,覆蓋默認的755權限。


通過linux的 man mount.cifs 簡單的了解下。

       file_mode=arg
           If the server does not support the CIFS Unix extensions this overrides the default file mode.

       dir_mode=arg
           If the server does not support the CIFS Unix extensions this overrides the default mode for directories.

示例:

mount -t cifs -o username=ftp,password=3dmedcom,rw,dir_mode=0777,file_mode=0777 //10.10.172.91/GENEbackup       /GENEbackup  #這樣看到的文件目錄權限都為777
mount -t cifs -o username=ftp,password=3dmedcom //10.10.172.91/GENEbackup       /GENEbackup   #經測試,可以讀寫。這樣看到的文件目錄權限都為755


mount.cifs Windows共享目錄權限755問題