mount.cifs windows shared directory permission 755 problem

For CentOS 6.5 system.


Mount the shared directory under Windows through the mount command of Linux. After mounting, the directory permission is 755, and ordinary users have no permission to write.



Permissions can be set by file_mode and dir_mode, overriding the default 755 permissions.


Simple understanding through linux's 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.

Example:

mount -t cifs -o username=ftp,password=3dmedcom,rw,dir_mode=0777,file_mode=0777 //10.10.172.91/GENEbackup /GENEbackup #The file directory permissions you see are all 777
mount -t cifs -o username=ftp,password=3dmedcom //10.10.172.91/GENEbackup /GENEbackup #After testing, it can be read and written. The file directory permissions seen in this way are all 755


Uninstall:

When you do not need to use this partition, you need to unmount the disk partition. Use umonut DEVICE or umont DEVICE_POINT to uninstall.
However, when we are uninstalling, we are just accessing this directory, then it will prompt that the device is busy and refuse to exit.
At this point, there are 2 solutions: 1. Exit this directory. 2. Use the fuser command to force quit.
# fuser -v /GENEbackup //fuser -v parameter to view users and processes using this partition
# fuser -km /GENEbackup //kill the process accessing the mount point
# umount /GENEbackup //Can be uninstalled normally


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324823097&siteId=291194637