我已经获得了 Windows 2000 服务器上网络共享的访问权限,我需要从 CentOs 7 机器访问该共享。
我已经创建了凭证文件:
username=MYUSER
password=MYPASS
domain=DOMAIN
我可以正确列出份额:
[root@localhost ~]# smbclient -L //share.domain.com -E -A /root/.credentials
Domain=[DOMAIN_NT_DOM1] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
...
尽管有时我会收到一个间歇性错误:
Connection to share.domain.com failed (Error NT_STATUS_IO_DEVICE_ERROR)
NetBIOS over TCP disabled -- no workgroup available
我甚至可以使用交换机将文件复制到本地-Tc
。
但是,当尝试挂载共享时,我收到“权限被拒绝”错误:
[root@localhost ~]# mount.cifs //share.domain.com/folder/folder2 /root/shared -o 'credentials=/root/.credentials,sec=ntlmv2' -v
domain=domain.com
mount.cifs kernel mount options: ip=172.16.70.4,unc=\\share.domain.com\folder,sec=ntlmv2,user=MYSUER,,domain=domain.com,prefixpath=folder2,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
为什么我可以列出并压缩文件smbclient
但无法挂载共享?
答案1
domain
通过从命令中删除该选项mount.cifs
或者从凭证文件中删除该选项,问题已得到解决。
例子:
修改前的credentials文件中:
username=MYUSER
password=MYPASS
domain=DOMAIN
修改后的credentials文件中:
username=MYUSER
password=MYPASS
命令修改前:
mount.cifs //share.domain.com/folder/folder2 /root/shared -o username=yourusername,sec=yourauthprotocol,domain=yourdomain
命令修改后:
mount.cifs //share.domain.com/folder/folder2 /root/shared -o username=yourusername,sec=yourauthprotocol