Raspberry Pi NTFS SAMBA SHARE 权限被拒绝 Windows 7

Raspberry Pi NTFS SAMBA SHARE 权限被拒绝 Windows 7

我正在运行一台小型 RaspberryPi 机器,我想将其转变为家庭网络上完全不受保护的低功耗网络共享,目的是使其成为通用的网络转储和媒体共享。

我已经安装了 USB 驱动器并从 Linux 上对其进行读写,可以从我的 Windows8(64 位)桌面看到共享,无需用户名或密码,但我在网络上的任何东西(包括我的 W7(64 位))都无法获得对该共享的读/写访问权限。

pi@SambaPi /var/log/samba $ uname -a
Linux SambaPi 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l GNU/Linux

fstab:

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/sda1  /media/USBDRIVE  ntfs-3g rw,defaults,acl       0      0

cat /etc/samba/smb.conf | egrep -v '^#|^;|^$' (Samba 配置中没有空格、注释和那些奇怪的分号(这些行是什么?)已被删除)

[global]
   workgroup = WORKGROUP
   realm = raspberrypi
   netbios name = raspberrypi
   server string = %h server
   dns proxy = no
   name resolve order = lmhosts host wins bcast
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 10
   panic action = /usr/share/samba/panic-action %d
   security = SHARE
   encrypt passwords = true
   passdb backend = tdbsam
   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
   socket options = TCP_NODELAY
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = yes
[USB]
   path = /media/USBDRIVE
   comment = Media Share
   writeable = yes
   browseable = yes
   guest ok = yes
   public = yes
   force user = root
   read only = no
   read only = yes
   create mask = 0775
   directory mask = 0775

getfacl /media/USBDRIVE

# file: USBDRIVE/
# owner: root
# group: root
user::rwx
group::rwx
other::rwx
default:user::rwx
default:group::r-x
default:other::r-x

getfacl /media/USBDRIVE/testFileMadeAtCommantLine.txt

# file: testFileMadeAtCommantLine.txt
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

我查看过我的系统日志,没有发现任何事物这与我尝试添加或删除共享文件时收到的权限消息相对应。

答案1

强制用户设置并不意味着您不必提供密码。来自 smb.conf:

此用户名仅在建立连接后才使用。因此,客户端仍需要以有效用户身份连接并提供有效密码。连接后,所有文件操作都将以“强制用户”身份执行,无论客户端以什么用户名连接。这非常有用。

指定来宾帐户值并授予此用户 rwx 权限。

您是否也在同一共享上指定了read only = yes和?修复它。read only = no

您可以使用测试参数命令检查 smb.conf 是否有错误并打印出裸 samba 配置。

答案2

Janis。你的回答对我帮助很大。而且它运行得很好。我删除了你推荐的内容,添加了你推荐的内容,并将权限和所有权更改为“类似客人”的用户。我的配置现在如下所示:

Pi 有一个用户名为 games。将所有文件 chown 给该用户,并授予 Games 所有权限。并按照您的建议更改了配置。

现在它运行良好,我的配置如下:

[global]
   workgroup = WORKGROUP
   realm = raspberrypi
   netbios name = raspberrypi
   server string = %h server
   dns proxy = no
   name resolve order = lmhosts host wins bcast
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 10
   panic action = /usr/share/samba/panic-action %d
   security = SHARE
   encrypt passwords = true
   passdb backend = tdbsam
   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
   socket options = TCP_NODELAY
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = yes
[USB]
   path = /media/USBDRIVE
   comment = Media Share
   writeable = yes
   browseable = yes
   guest ok = yes
   guest account = games
   public = yes
   read only = no
   create mask = 0775

相关内容