You need to set the folder on a shared file on Windows when the server is deployed. After you mount to Linux using the Mount command. File paths and files are accessible, but cannot be written, causing the system to upload files when the prompt "insufficient permissions, no write permission." The permission setting for viewing mounted files with "Ls-l" is drwxr-xr-x, obviously without write permission. Take it for granted that you use chmod to change folder permissions, resulting in insufficient permissions. Neither root nor the current user can modify permissions properly. So no words, I do not know how to carry out.
(Windows permissions Remember whether password Authentication is turned on, public and advanced sharing settings)
When you use the following command to mount a shared folder on Windows Linux, it is found to be accessible in Linux after success, but cannot be modified.
[Plain]View PlainCopy
- MOUNT-T cifs-o username= "* * *", password= "* * *"//windowshost/sharefolder/home/xxx/shared
Using Ls-l shared also discovers that the shared directory owner and user group are root, even if you use sudo chmod and sudo chown to modify the permissions. However, you can add two parameters to achieve the desired effect:
[Plain]View PlainCopy
- MOUNT-T smbfs-o username= "* * *", password= "* *", gid= "* * *", uid= "* * *"//windowshost/sharefolder/home/xxx/shared
The GID, uid in the attribute, is the GID and UID of the user you want to mount. As for this GID and UID, you can use the ID username to obtain, for example, my xxx, the user obtains the GID and UID is 1000.
Both username and password in the above command are accessed for windowshost.
Example: I am using LNMP one-click Install package, run Nginx user's www, I will use the id www query his gid uid and then mount it will not appear the issue of permissions!
Unload mount directory: sudo umount shared
Machine Restart auto mount, Vi/etc/fstab last added:
[Plain]View PlainCopy
- windowshost/sharefolder/home/xxx/shared cifs defaults,auto,username= "xxxx", password= "* * *", gid= "$", uid= "1000 "0 0
Mount mount Windows shared files permissions problem on Linux