Ubuntu Server 20.04-cifs 挂载不起作用。cifs_mount 失败,返回代码 = -2

Ubuntu Server 20.04-cifs 挂载不起作用。cifs_mount 失败,返回代码 = -2

Ubuntu Server 20.04 在 Raspberry Pi 4 上全新安装并安装cifs-utils

sudo mount.cifs //192.168.0.5/SharedDirectory /home/ubuntu/windowshare -o user=myusername,password=mypass

上述用于挂载 Windows 共享目录的命令在 Raspberry OS 上完美运行。

尝试对安装在 Raspberry Pi 4 上的 Ubuntu Server 20.04 执行相同操作,无论我们做什么更改,它总是会抛出以下错误

mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

消息

[  820.858461] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[  831.210444] CIFS VFS: Error connecting to socket. Aborting operation.
[  831.217074] CIFS VFS: cifs_mount failed w/return code = -2
[  845.175971] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[  855.530623] CIFS VFS: Error connecting to socket. Aborting operation.
[  855.537245] CIFS VFS: cifs_mount failed w/return code = -2
[  975.632052] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[  985.835320] CIFS VFS: Error connecting to socket. Aborting operation.
[  985.841947] CIFS VFS: cifs_mount failed w/return code = -2
[  998.518298] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[ 1008.875451] CIFS VFS: Error connecting to socket. Aborting operation.
[ 1008.882082] CIFS VFS: cifs_mount failed w/return code = -2

阅读了一些帖子和文章后尝试了以下选项,但没有成功:

  1. 禁用 ipv6
  2. vers=1.0(也尝试过 2.0、3.0)
  3. noauto,x-systemd.automount

编辑:还尝试启用以下服务

sudo systemctl enable systemd-networkd-wait-online

sudo systemctl enable systemd-networkd.service

sudo systemctl enable NetworkManager-wait-online.service

答案1

解决。

Windows 防火墙防御者正在阻止它。

必须在防火墙设置中的允许应用中允许@netlogon.dll。

在此处输入图片描述

相关内容