Does this help? (Brave A.I. result.)
Control NAS Access via FSTAB
To control user access to a NAS via FSTAB settings, you can use various options in the /etc/fstab file to specify user and group permissions, as well as access controls. Here are the key methods:
- Using
uid
and gid
: You can specify the user ID (uid) and group ID (gid) to control ownership of the mounted filesystem. This allows you to set the owner and group of the mounted directory to a specific user and group. For example:
//192.168.1.100/share /mnt/network_drive cifs credentials=/home/your_username/.smbcredentials,iocharset=utf8,sec=ntlm,uid=1000,gid=1000 0 0
This ensures that the mounted directory is owned by the user with uid 1000 and group with gid 1000.
- Using
umask
: For filesystems that do not support traditional Unix permissions (like FAT or NTFS), you can use the umask
option to set the default permissions. For example:
/dev/sdb1 /media/workspace auto defaults,uid=1000,gid=1000,umask=022 0 1
This sets the permissions so that the owner has read, write, and execute access, while the group and others have read and execute access.
- Using
chown
and chmod
: After mounting, you can use chown
and chmod
to change the ownership and permissions of the mounted directory. For example:
sudo chown -R user:group /mnt/network_drive
sudo chmod -R 755 /mnt/network_drive
This changes the ownership to a specific user and group and sets the permissions to allow read, write, and execute for the owner, and read and execute for others.
- Using ACLs (Access Control Lists) : For more granular control, you can use ACLs to set specific permissions for users and groups. This is particularly useful for filesystems that support ACLs. For example:
setfacl -m u:user:rwx /mnt/network_drive
setfacl -m g:group:rwx /mnt/network_drive
This sets read, write, and execute permissions for a specific user and group.
5. Restricting access through a subdirectory : You can create a subdirectory within the mount point and set permissions on that subdirectory to restrict access. For example:
mkdir -p /media/group1only/workspace
chgrp group1 /media/group1only
chmod 750 /media/group1only
This ensures that only members of the specified group can access the subdirectory.
By using these methods, you can effectively control user access to a NAS via FSTAB settings. Each method has its own use case, and the choice depends on the specific requirements and filesystem type.
AI-generated answer. Please verify critical facts.

askubuntu.com
samba - How do I mount a CIFS share via FSTAB and give full RW to Guest - Ask Ubuntu

baeldung.com
How to Configure /etc/fstab for Network Drive | Baeldung on Linux

reddit.com
r/linuxquestions on Reddit: FSTAB blues I want all users to get access to drives

reddit.com
r/synology on Reddit: Mounting via fstab on Linux- Not able to change ownership/group for read/write permissions ?

unix.stackexchange.com
permissions - Automatically mount a drive using /etc/fstab, and limiting access to all users of a specific group - Unix & Linux Stack Exchange

unix.stackexchange.com
mount - How to edit /etc/fstab properly for network drive? - Unix & Linux Stack Exchange

superuser.com
linux - Modify fstab entry
I also found this old thread on askubuntu, not sure if relevant:
https://askubuntu.com/questions/1539144/issues-with-programs-accessng-smb-nas