个人一点小经验分享

 我们在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就行了.


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