file/folder permissions issue

Discussion about using NAS on Linux and Unix OS.
Post Reply
timiti29
New here
Posts: 2
Joined: Thu Jul 23, 2015 12:08 am

file/folder permissions issue

Post by timiti29 »

Hello,

I've a QNAP TS-431 (Version 4.3.6.1446 Build 20200929) and i woul'd like to share a folder with m'y raspberry pi with NFS, and i'm confronted to an issue with user permission.

I've done some test and simplified at maximum to reproduce the issue in command-line :

Connect to NAS with SSH in admin

[~] # cd/share/CACHEDEV1_DATA
[/share/CACHEDEV1_DATA] # mkdir test
[/share/CACHEDEV1_DATA] # chmod 777 test
[/share/CACHEDEV1_DATA] # chown user1:administrators test
[/share/CACHEDEV1_DATA] # ls -ln
drwxrwxrwx 2 user1 administrators 4096 Nov 26 17:29 test/

I will create a folder in test folder as user2 :

[/share/CACHEDEV1_DATA] # sudo -u user2 bash -c 'mkdir test/folder1'
[/share/CACHEDEV1_DATA] # ls -l test
drwxr-xr-x 2 user2 everyone 4096 Nov 26 17:34 folder1/
[/share/CACHEDEV1_DATA] # rmdir test/folder1/

works fine, we got our folder created by user2 owner to user2 because we use the default linux permissions :

[/share/CACHEDEV1_DATA] # getfacl test
# file: test
# owner: user1
# group: administrators
user::rwx
group::rwx
other::rwx

But if i use ACL for example to add user3 read write permission :
[/share/CACHEDEV1_DATA] # setfacl -m u:user3:rwx test
[/share/CACHEDEV1_DATA] # getfacl test
# file: test
# owner: user3
# group: administrators
user::rwx
user:user3:rwx
group::rwx
mask::rwx
other::rwx
[/share/CACHEDEV1_DATA] # sudo -u user3 bash -c 'mkdir test/folder1'
[/share/CACHEDEV1_DATA] # rmdir test/folder1/
[/share/CACHEDEV1_DATA] # sudo -u user2 bash -c 'mkdir test/folder1'
mkdir: Cannot create directory `test/folder1': Permission denied

User3 can now create a directory, but user2 can't create it, the permissions other is set to rwx.

I don't understand what's wrong ?

Best regards,
Timiti29


Edit: corrected some typo
Last edited by timiti29 on Fri Nov 27, 2020 5:23 am, edited 1 time in total.
Mousetick
Experience counts
Posts: 1081
Joined: Thu Aug 24, 2017 10:28 pm

Re: file/folder permissions issue

Post by Mousetick »

Unable to determine if your test is valid and your transcription is accurate. The output is inconsistent: the second getfacl shows the owner is 'raspberry', while it should be 'user1'. Not sure if the rest of your test is correctly typed or not.
timiti29
New here
Posts: 2
Joined: Thu Jul 23, 2015 12:08 am

Re: file/folder permissions issue

Post by timiti29 »

Hi,

I've change the user name to post on this topic to simplify the comprehension of the issue and i've forgotten to rename the user of the owner on second getfacl.

The three user was created by gui without changing user/group permissions.

Best regards,
Timiti29
Mousetick
Experience counts
Posts: 1081
Joined: Thu Aug 24, 2017 10:28 pm

Re: file/folder permissions issue

Post by Mousetick »

I tested your scenario on Debian Linux and it works as expected. I don't know why it doesn't on your NAS, it's puzzling. I can't verify on mine since I have disabled ACLs.
CarbonPepper
Getting the hang of things
Posts: 66
Joined: Tue Nov 10, 2015 6:56 pm

Re: file/folder permissions issue

Post by CarbonPepper »

You should use chown -R for folders
In linux each folder has two hidden files inside it, which are dots, . and ..
They must have the same permissions as the folder itself.

In addition, the UID numbers for a user need to match on both the QNAP and the raspberry.

if user3 on raspberry does not have the same UID as user3 on QNAP they will not have permission.

Also recommend that you don't use group administrators, create your own group.
"If QNAP made airbags, they’d test new versions using your face."
------------------------------------------------------------------------------__
TVS-471 with 4x WD Red 3Tb. Used for business. Stability valued over features.
Mix of clients: Ubuntu Linux, Mac OS, Windows 10.
Post Reply

Return to “Linux & Unix (NFS)”