How to set Shared-folders permissions on NS8

Hi all,

I’m moving files from an old Freenas and using rsync.
The thing is that it’s transfering and carrying the permissions from the freenas.
When I go to the Set Permissions on the GUI it replies:

  File "/home/samba1/.config/actions/reset-share-acls/50reset_share_acls", line 34, in <module>
    phelper.check_returncode()
  File "/usr/lib64/python3.11/subprocess.py", line 502, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '('podman', 'exec', 'samba-dc', 'samba-reset-acls', '-g', 'rh', '-p', 'ergrw', 'rh')' returned non-zero exit status 1.

You could reset file owner and group to the samba instance user.

In this example the owner/group for share sambashare and its content in samba instance samba1 are set to the samba instance user samba1:

chown -R samba1:samba1 /home/samba1/.local/share/containers/storage/volumes/shares/_data/sambashare

Now set permissions from the UI should work to make the shares accessible.

2 Likes

Still no dice, I get the same reply above.
From the log it says:

module/samba1/reset-share-acls

Task ID: Copy to clipboard0650822b-d5a2-4a40-9ae4-232a754bae09

<7>podman exec samba-dc samba-reset-acls -g share -p grw share
find: ‘share/othershare’: Permission denied

Traceback (most recent call last):
File “/home/samba1/.config/actions/reset-share-acls/50reset_share_acls”, line 34, in
phelper.check_returncode()
File “/usr/lib64/python3.11/subprocess.py”, line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout.

Could you please share the result of following commands to show the owner/permissions.

Check the dir where the shares are located:

runagent -m samba1 podman exec samba-dc ls -l /srv/shares

Check the share:

runagent -m samba1 podman exec samba-dc ls -l /srv/shares/share
[root@ibm _data]# runagent -m samba1 podman exec samba-dc ls -l /srv/shares
total 716
drwxrwxr-x.  7 root users 462848 Feb 28 14:16 check-list
drwxrwxr-x.  3 root users     27 Feb 26 17:18 docs
[root@ibm _data]# runagent -m samba1 podman exec samba-dc ls -l /srv/shares/docs
ls: cannot access '/srv/shares/docs/ATA DE REUNI'$'\303\203\302\203''O 16-03-20.docx': Permission denied
total 88
-??????????  ? ?    ?       ?            ? 5W2H - Webinar.xlsx
drwxrws---.  2 root root   66 Mar  3 17:47 Photos

@mrmarkuz
This is after I chown -R samba1:samba1 folder

Thanks,

Owner, group and permissions are correctly set on the share so it seems resetting the rights worked until it hits “permission denied”.

This file name could lead to issues. Please rename it to remove the special characters.

Just the filename is shown, this can be the case when permissions are missing.

Let’s check again as root:

ls -l /home/samba1/.local/share/containers/storage/volumes/shares/_data/docs

Hi Markuz,

drwxrwxr-x. 2 samba1 362243 6 Feb 26 14:18 test

This happens even if I rename it removing the special characters.

Thanks,

[EDIT] I tought it was an issue with the folders only, but I was wrong.

I went further and it’s something that happens if you SCP the files to the server and try to chown / set the permissions by the GUI.
I tried to chown -R samba1:samba1 and samba1:362243 which is the user the GUI sets ownership to the files and I get the same error.

When I run:
runagent -m samba1 podman exec samba-dc ls -l /srv/shares/docs
ls: cannot access ‘/srv/shares/docs/CONVITE.pdf’: Permission denied

Thanks,

Just to clarify: In the container it’s root:users which is the same as samba1:362243 on the host.
I’ll try to reproduce and report…

When uploading the files via SCP I get the same error when setting permissions but after chown -R samba1:samba1 … as root, it’s working.

Set the owner to the same one of the share: (root:users)

chown -R --reference=/home/samba1/.local/share/containers/storage/volumes/shares/_data/share /home/samba1/.local/share/containers/storage/volumes/shares/_data/share

Maybe you need to also reset the permissions:

For directories:

find /home/samba1/.local/share/containers/storage/volumes/shares/_data/share -type d -exec chmod 775 {} \;

For the files:

find /home/samba1/.local/share/containers/storage/volumes/shares/_data/share -type f -exec chmod 664 {} \;

Now setting permissions via UI should hopefully work again.

1 Like

Hi @mrmarkuz,

I lost access testing The second drive
I’ll probably have to edit the fstab to bring back up, which I’ll be doing tomorrow.
It’s a real server and not a VM :neutral_face:

Thanks,

Hi @mrmarkuz,
Still does not work unfortunately!

I tried setting via chown and exec as you posted above, without success!
The name of the folders does not make a difference.

Thanks,

1 Like

I still can’t reproduce even if I scp from my xigmanas to the NS8 or from a Windows system via WinSCP it’s enough to just execute

chown -R --reference=/home/samba1/.local/share/containers/storage/volumes/shares/_data/share /home/samba1/.local/share/containers/storage/volumes/shares/_data/share

to be able to reset the permissions from the UI.

Do you use Rocky or Debian for the NS8?
How do you upload the files? Could you share the commands?

Hi Mr. Markuz,
I use Rocky.
I use SCP
tar -cpvzf files.tar.gz files
scp files.tar.gz root@NS8:

Thanks,

1 Like

Does it work without the -p option which preserves the permissions?

tar -cvzf files.tar.gz files

Of course owner and permissions need to be changed after extracting as explained.

How do you extract the files to the share directory on the NS8?