個人一點小經驗分享

 我們在LINUX下掛載windows分區後,默認情況下,掛載的分區只有root用戶可以讀寫.

 有沒有辦法讓掛載的分區能讓普通用戶也可以正常讀寫呢?

         man mount發現如下一段話:

         uid=value and gid=value
              Set  the owner and group of the root of the file system (default: uid=gid=0, but with option uid or gid without specified value, the uid and gid of the current process are taken).

         原來在掛載時加上這兩個選項就可以了,如下:

         mount  -o uid=509,gid=509 //172.30.1.71/p_w_picpathssource /data/p_w_picpaths

         (509是需要讀寫該分區的普通用戶的UID和GID)

         再用UID爲509的用戶登錄後測試發現在該分區讀寫正常了.

         當然,如果你用/etc/fstab文件配置的話,直接在defaults後面加上,uid=500,gid=500就行了.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章