linux下访问windows共享目录问题记录

来源:互联网 发布:java ant jar包 编辑:程序博客网 时间:2024/05/21 21:01

windows环境:win7

linux环境:(1)Fedora9 (2)Fedora8(3)win7下虚拟机VMware上跑的debian


在win7建立了一个共享的目录PUB,设置为可读可写,然后通过不同的linux终端去访问。在(1)上使用以下命令,一切OK

sudo mount -t cifs -o username=domain/user,password=passwd //172.18.120.33/PUB ./tmp


然后跑到(2)上使用同样命令出现以下问题:(其实后来发现成功mount上之后,用这个命令又可以了)

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

于是把命令改成

sudo mount -t cifs -o username=domain/user,password=passwd ‘\\/172.18.120.33\PUB' ./tmp

就OK了。


然后再到(3)上使用上面2个命令都是同样错误:

mount: block device //172.18.120.33/PUB is write-protected, mounting read-only
mount: cannot mount block device //172.18.120.33/PUB read-only

虚拟机窗口出现:

CIFS VFS: Send error in SessSetup = -13

CIFS VFS: cifs_mount failed w/return code = -13


网上查了下有说需要安装smbclient,发现没装,于是赶紧。安装后发现问题依旧。也有说密码错误的。

万念俱灰之后网上发现了mount.cifs的命令说明文档:http://h30097.www3.hp.com/docs/iass/OSIS_63/MAN/MAN8/0122____.HTM

于是将命令改为:

sudo mount -t cifs -o domain=domain,username=user,password=passwd‘\\/172.18.120.33\PUB' ./tmp

居然好了,感谢上帝!