详解Centos中mount命令挂载windows7共享目录
<p>1) 在ip:10.4.35.77的windows机器上新建用户。这里新建用户名:myshare,密码:myshare123。</p>
<p>
2) 选择 【计算机】右键 选择【管理】,本地用户和组,用户 =》右键,新建用户。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/5bd24293277f70533ce98c1bbba467d5.jpg"></p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/43d60289df6d6ad6042b5ed3291cf4a1.jpg"></p>
<p>
3)查看myshare的域。依次:控制面板\所有控制面板项\用户帐户。管理用户。可以看到域为:JSZX-YH-59。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/e73a44a7dbedc0debb33c9143053e585.jpg"></p>
<p>
4)新建共享目录。在F盘新建mytest目录(F:\mytest)。选中mytest。点击右键。选择属性。点击共享。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/ca4e70c0844be6f0e64645d514bd4560.jpg"></p>
<p>
5)查找用户。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/0688761c8bcd75e943e3d0ef078570cd.jpg"></p>
<p>
6)点击位置选着:JSZX-YH-59域。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/d23d379783b62c12bfd03b1df136aa41.jpg"></p>
<p>
7)输入myshare用户。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/0193162ebc0d8dc92f2e16248fb87050.jpg"></p>
<p>
8)设置myshare对mytest的读写权限。点击共享。</p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/7ef1b97546a5a047239cc8e8e59d0a52.jpg"></p>
<p>
9)在IP:10.1.20.21的linux上挂载mytest目录。</p>
<pre>
# mkdir /mnt/mytest
# mount -o username=myshare,password=myshare123 //10.4.35.77/mytest /mnt/mytest</pre>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/5df6103b8bd10defe0a76410367c8524.jpg"></p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/a5fd14699941521f5a04ced5dc9952e6.jpg"></p>
<p>
<img style="max-width:100%!important;height:auto!important;"title="详解Centos中mount命令挂载windows7共享目录" alt="详解Centos中mount命令挂载windows7共享目录" src="https://zhuji.jb51.net/uploads/img/202305/d6235742ebfee11b6b63ec45406fd289.jpg"></p>
<p>
<strong>扩展:</strong></p>
<p>
由于mount命令只能由root权限用户使用。其挂载文件夹的默认owner和group都为root,并且不能通过chmod命令更改权限。</p>
<p>
1)使用mount命令,给挂载共享文件夹指定owner和group。uid表示用户。gid表示组</p>
<p>
</p>
<pre>
# mount -o username="myshare",password="myshare123",uid=dev,gid=dev //10.4.35.77/mytest /mnt/mytest
</pre>
<br><p>
</p>
<p>
2)给mount共享文件夹所在组的写权限。</p>
<p>
</p>
<pre>
# mount -o username="myshare",password="myshare123",uid=dev,gid=dev,dir_mode=0777 //10.4.35.77/mytest /mnt/mytest
</pre>
<p>
</p>
<p>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。</p>
<p>
原文链接:http://blog.csdn.net/clevercode/article/details/51209853</p>
頁:
[1]