为什么我会收到‘权限被拒绝’ cifs?

为什么我会收到‘权限被拒绝’ cifs?

最近我不得不重新安装具有 zfs 池的 Ubuntu Server 20.04。安装后,我能够恢复 zfs 卷。

但是我无法从 Ubuntu Desktop 20.04 写入该卷,并收到“权限被拒绝”错误。为什么我会收到此错误?可能是 zfs 卷的恢复出了问题吗?即使是 root 也无法写入此 smb 共享。

workstation:
  $ id
  uid=1000(larry) gid=1000(larry) groups=1000(larry),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare),997(docker)

  $ mount | grep data
  //192.168.10.20/data on /mnt/data type cifs 
  (rw,relatime,vers=3.0,cache=strict,username=larry,uid=1000,noforceuid,gid=1000,
  noforcegid,addr=192.168.10.20,file_mode=0755,dir_mode=0755,
  soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,
  bsize=1048576,echo_interval=60,actimeo=1)

server:
  $ id
  uid=1000(larry) gid=1000(larry) groups=1000(larry),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lxd)
  
  $ zfs get all tank/data
  NAME       PROPERTY              VALUE                  SOURCE
  tank/data  type                  filesystem             -
  tank/data  setuid                on                     default
  tank/data  readonly              off                    default
  tank/data  aclinherit            restricted             default
  tank/data  sharesmb              off                    default

  From /etc/samba/smb.conf:
  [global]
         workgroup = WORKGROUP
         server string = Samba Server
         netbios name = ubuntu
         security = user
         map to guest = bad user
         dns proxy = no
         [data]
         path = /tank/data
         browsable =yes
         writable = yes
         guest ok = yes
         read only = no
         create mask = 644

List directories:
  Server:
    $ ls -ld Larry*
    drwxr-xr-x 55 larry larry 118 Apr  6 15:01 Larry/
    drwxr-xr-x  2 larry larry   2 Sep 10 06:56 Larry2/

  Workstation:
    $ ls -ld /mnt/data/Larry*
    drwxr-xr-x 2 larry larry 0 Sep 10 08:56 /mnt/data/Larry/
    drwxr-xr-x 2 larry larry 0 Sep 10 08:56 /mnt/data/Larry2/

Perform tests:
  Server:
    $ touch Larry/test
    $ touch Larry2/test
    $ rm Larry/test Larry2/test

  Workstation:
    $ touch /mnt/data/Larry/test
    touch: cannot touch '/mnt/data/Larry/test': Permission denied
    $ touch /mnt/data/Larry2/test
    touch: cannot touch '/mnt/data/Larry2/test': Permission denied
    $ sudo touch /mnt/data/Larry/test
    touch: cannot touch '/mnt/data/Larry/test': Permission denied

答案1

我需要重新设置 zfs 数据集的权限,例如:

chown -R me:me /tank/dataset1

相关内容