直接在Linux中执行此命令
mount //idc-***-***-*-test.com.cn(或者IP)/cifs_testuser /data -t cifs -o username=testuser,passwd=a\!a@test007
如果想要在开机自启中实现自动挂载:
方案一:将上述命令拷贝到/etc/rc.d/boot.local中,授予此文件执行权限
方案二:在/etc/fstab文件中添加
//idc-***-***-*-test.com.cn/cifs_testuser /data cifs defaults,sec=ntlm,username=testuser,passwd=a!a@test007 0 2
sec的值可以搜一下,内核版本不一样值也有相应的改变,挂载出错和sec的值是有关系的
windows共享的磁盘在Linux磁盘中挂在时,不加-t cifs,在使用mount挂载后用df -hT查看也是cifs的格式。mount的用户名密码如果存在特殊字符,需要用\进行转义。
以下方案详见:Windows2003不能访问samba及Linux不能挂载共享文件夹中NTLMv2的作用
# mount -t cifs -o username='lixshareusr',password='abc%1234' //10.*.*.112/sharetolinux /mnt
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


本文详细介绍了如何在Linux系统中挂载Windows共享目录,包括直接执行挂载命令的方法,以及如何通过修改/etc/rc.d/boot.local或/etc/fstab实现开机自动挂载。特别注意挂载参数sec的设置和用户名密码中特殊字符的转义。
1450

被折叠的 条评论
为什么被折叠?



