Score:0

Why am I getting 'permission denied' cifs?

br flag

Recently I had to re-install Ubuntu Server 20.04, which had a zfs pool. After the installation, I was able to restore the zfs volume.

But I cannot write to that volume from an Ubuntu Desktop 20.04, receiving a 'permission denied' error. Why am I getting this error? Could it be something with the restoration of the zfs volume? Even root cannot write to this smb share.

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
Someone avatar
my flag
Have you tried using -rf flag with the touch command ?
Score:0
br flag

I needed to redo permissions on the zfs datasets, something like:

chown -R me:me /tank/dataset1
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.