Possibility to set UID and GID in User management

Tell us your most wanted features from QNAP products.
mwilck
New here
Posts: 6
Joined: Sat Aug 16, 2014 6:47 pm

Re: Possibility to set UID and GID in User management

Post by mwilck »

jayadam wrote:I have verified that a UID is assigned to windows users who create files on the NAS who are authenticated via AD; I just don't know where that UID comes from.
Check the idmap_backend setting in /etc/config/smb.conf, and any other winbind related settings.
mwilck
New here
Posts: 6
Joined: Sat Aug 16, 2014 6:47 pm

Re: Possibility to set UID and GID in User management

Post by mwilck »

The best method for ensuring predictable UIDs and GIDs is to edit /etc/group, /etc/passwd and /etc/config/smbpasswd on the NAS (and change the GID/UID) immediately after creating the group or user in the Web UI . No need to change ownership (chown) of anything in this case.
kcalvert
New here
Posts: 4
Joined: Sun Sep 27, 2015 3:34 am

Re: Possibility to set UID and GID in User management

Post by kcalvert »

I have my uid and gid's all matching between the qnap device and the nfs client (just one client for now) and its seemingly ignoring the group.

i.e.

two users: kevin (1000), www (1001)
group: storage (1002)

The two users both have storage as their primary group. This is matching between the qnap device and the nfs client.

as kevin:
mkdir test
chown kevin:storage test
chmod 775 test
cd test
touch test
*ok*

as www:
cd test
touch test2
*perm denied*

Any ideas? www is in the storage group but it's just flat out being ignored. I'm really not sure how something so simple can be this frustrating.
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: Possibility to set UID and GID in User management

Post by schumaku »

kcalvert wrote:The two users both have storage as their primary group. This is matching between the qnap device and the nfs client.
This is mainly suggested so both management environments see the same names, resp. the same names match to the same uid and gid. The names of uid and gid are not relevant when it comes the file system or NFSv3 access. the NAS NFS server does not "protect" anything - the issue you see is a NFS client-side problem most likely.

The U**x protection mask of the mount point, the exported shared folder or the folder holding the test folder are set the same way permitting wrote access to the group?
kcalvert
New here
Posts: 4
Joined: Sun Sep 27, 2015 3:34 am

Re: Possibility to set UID and GID in User management

Post by kcalvert »

schumaku wrote:
kcalvert wrote:The two users both have storage as their primary group. This is matching between the qnap device and the nfs client.
This is mainly suggested so both management environments see the same names, resp. the same names match to the same uid and gid. The names of uid and gid are not relevant when it comes the file system or NFSv3 access. the NAS NFS server does not "protect" anything - the issue you see is a NFS client-side problem most likely.

The U**x protection mask of the mount point, the exported shared folder or the folder holding the test folder are set the same way permitting wrote access to the group?
I'm not entirely sure what you mean there.

Basically, this is what I see.

From the qnap device:

[/share/storage] # id kevin
uid=1000(kevin) gid=1002(storage)

[/share/storage] # ll
drwxrwxr-x 12 admin storage 4.0k Sep 26 16:27 ./
drwxrwxrwx 26 admin administ 4.0k Sep 26 16:33 ../
drwxrwxr-x 2 admin storage 4.0k Sep 26 15:18 test/
[/share/storage] #


From the nfs client:

kevin@tobias:/srv/storage/test$ id
uid=1000(kevin) gid=1002(storage) groups=1002(storage),4(adm),24(cdrom),27(sudo),30(dip),33(www-data),46(plugdev),109(sambashare),119(libvirtd),120(lpadmin)

kevin@tobias:/srv/storage/test$ cd ..

kevin@tobias:/srv/storage$ ll
total 88K
drwxrwxr-x 12 root storage 4.0K Sep 26 16:27 ./
drwxr-xr-x 4 root root 0 Sep 26 16:26 ../
drwxrwxr-x 2 root storage 4.0K Sep 26 15:18 test/

kevin@tobias:/srv/storage$ cd test

kevin@tobias:/srv/storage/test$ ll
total 16K
drwxrwxr-x 2 root storage 4.0K Sep 26 15:18 ./
drwxrwxr-x 12 root storage 4.0K Sep 26 16:27 ../

kevin@tobias:/srv/storage/test$ touch test
touch: cannot touch ‘test’: Permission denied
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: Possibility to set UID and GID in User management

Post by schumaku »

Check the protection mask of the storage folder on your U**x system in /srv
kcalvert
New here
Posts: 4
Joined: Sun Sep 27, 2015 3:34 am

Re: Possibility to set UID and GID in User management

Post by kcalvert »

schumaku wrote:Check the protection mask of the storage folder on your U**x system in /srv
/srv/ is actually a symlink to the mount...

kevin@tobias:/srv$ ll
total 16K
drwxr-xr-x 4 root root 4.0K Sep 24 16:10 ./
drwxr-xr-x 25 root root 4.0K Sep 24 07:36 ../
lrwxrwxrwx 1 root root 16 Sep 24 16:09 storage -> /mnt/nfs/storage/

kevin@tobias:/mnt/nfs$ ll
total 12K
drwxr-xr-x 4 root root 0 Sep 26 16:26 ./
drwxr-xr-x 4 root root 4.0K Sep 23 22:31 ../
drwxrwxr-x 12 root storage 4.0K Sep 26 16:27 storage/

kevin@tobias:/mnt/nfs/storage$ ll
total 88K
drwxrwxr-x 12 root storage 4.0K Sep 26 16:27 ./
drwxr-xr-x 4 root root 0 Sep 26 16:26 ../
drwxrwxr-x 2 root storage 4.0K Sep 26 15:18 test/

... and this mnt (/mnt/nfs/storage) is being mounted via autofs...

kevin@tobias:/mnt/nfs/storage$ cat /etc/auto.misc
storage -fstype=nfs,rw,async,hard,intr,nodev,nosuid nas:/storage
jim1atl
New here
Posts: 3
Joined: Tue Jul 06, 2021 8:58 pm

Re: Possibility to set UID and GID in User management

Post by jim1atl »

Quite disappointing, this appears to be an ask from many years ago.. I may yet return a 4 day old NAS and swap for something with a better management UI which does allow UID/GID specification.

Good Going QNAP you listen to user requests very well!
I am highly impressed. :lol:
User avatar
dolbyman
Guru
Posts: 35024
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Possibility to set UID and GID in User management

Post by dolbyman »

qnap does not come here...so necroposting in these threads does not help fixing issues

marked for closure
Locked

Return to “Features Wanted”