Ubuntu 20.04 Samba 共享至 Windows,添加了第二个驱动器但无法识别

Ubuntu 20.04 Samba 共享至 Windows,添加了第二个驱动器但无法识别

我在 Ubuntu 20.04 上配置了一个服务器/Plex 媒体服务器,为了直接传输和下载文件,我使用以下命令设置了 Samba 共享教程,运行完美。

我添加了一个额外的硬盘来扩展 PC 的存储空间,并阅读了多种有关如何将其安装或添加到 Samba 以便访问的方法;但是,这些方法都不起作用,其中最流行的两种方法是:

  • 将其挂载到已与 Samba 共享的现有目录:
    它在 Linux 机器上运行,但 Windows 仅将其识别为原始驱动器而不是新的驱动器。
  • 将其挂载到新目录中并在其中添加新共享smb.conf
    [harddrive]
      path = /media/Storage
      writeable = yes
      valid users = %S
    

我做错了什么吗,或者有其他方法可以做到这一点?

  • 原来的smb.conf
    [global]
      workgroup = WORKGROUP
      server string = %h server (Samba, Ubuntu)
      log file = /var/log/samba/log.%m
      max log size = 1000
      logging = file
      panic action = /usr/share/samba/panic-action %d
      server role = standalone server
      obey pam restrictions = yes
      unix password sync = yes
      passwd program = /usr/bin/passwd %u
      passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
      pam password change = yes
      map to guest = bad user
      usershare allow guests = yes
    [printers]
      comment = All Printers
      browseable = no
      path = /var/spool/samba
      printable = yes
      guest ok = no
      read only = yes
      create mask = 0700
    [print$]
      comment = Printer Drivers
      path = /var/lib/samba/printers
      browseable = yes
      read only = yes
      guest ok = no
    [homes]
      comment = Home Directories
      browseable = yes
      read only = no
      create mask = 0700
      directory mask = 0700
      valid users = %S
    [public]
      comment = public anonymous access
      path = /var/samba/
      browsable =yes
      create mask = 0660
      directory mask = 0771
      writable = yes
      guest ok = yes
    

答案1

我可以通过在 smb.conf 中的 [harddrive] 部分下明确命名用户来解决该问题,如下所示:

[硬盘] 路径 = /media/Storage 可写 = 是 有效用户 = 用户名

相关内容