Cannot scan and mount shared directories normally during file sharing between Windows and Linux


①Fault phenomenon

Scenes:

  1. When performing file sharing between Windows (host) and Linux (VMware), the shared directory cannot be mounted
  2. The shared directory could not be scanned before (smbclient -L //[host IP address])

Error code:

[root@kvm ~]# mount.cifs //192.168.126.1/JX /gongxiang/
Password for root@//192.168.126.1/JX:  ********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

②Solution ideas

1. First of all, think about why you can’t scan the shared directory that you have set up?

The author has written a related article before: To realize file sharing between Windows and Linux , it is recommended to see the detailed configuration process

The configuration process is correct, and then check Windows and Linux, whether the firewalls of both are turned off, yes, and the Selinux security access control mechanism of Linux should also be turned off (setenfoce 0)

First give the author's solution↓
mark

mark

After that, I input the command "smbclient -L //[Windows IP]" on Linux, and I can see it

2. Think about it again, why can't I mount the shared directory?

Here I used NetEase Cloud to translate the error code, and the result is

安装错误(13):权限被拒绝
参考mount cifs(8)手册页(如man mount.cifs)

Provide the author's final solution here

[root@kvm ~]# mount.cifs //192.168.126.1/JX /mnt		#不是'/mnt/'
Password for root@//192.168.126.1/JX:  ********			#Win10的登录密码
[root@kvm ~]# cd /mnt/
[root@kvm mnt]# ls
CentOS-7-x86_64-DVD-2009.iso

总结:
1.挂载的对象目录,比如'/mnt'下,结尾不要再加个'/'
2.Win10登录密码要输入正确!这个你忘了真的是欲哭无泪
3.共享目录最好放在桌面,然后其属性要设置正确
4.检查两者的防火墙(呵呵,没想到吧,是我)
5.配置步骤认真仔细的检查!

Guess you like

Origin blog.csdn.net/weixin_51486343/article/details/114447843