If I understand correctly, you want to set read+write permissions for a group of users and grant read-only access to everyone else. This can be done using the command line.
Disclaimer & further reading
Before running any of the commands from the internet, you should understand what they do. The simplest way is to read their manual pages.
Procedure
Add (+
) the group write and read permission for the folder Recursively. Add the read permission and remove (-
) the write permission for others.
chmod -R g+rw,o+r-w /data
Don’t change the permissions using number codes as especially the execute permission may vary among files and folders and should be kept.
Create a new group, e.g. admins
, and add all the users who shall get read+write permissions to it.
sudo addgroup admins
for user in admin nwadmin hwadmin; do sudo adduser $user admins; done
# ↖ ↑ ↗
# list the users here
Set the folder as owned by the admins
group (Recursively).
chgrp admins /data
Additional notes
As you have claimed to “have very limited knowledge in all things Linux”, I’d like to bring your attention to the following concerns.
Using sudo
You can find a lot of sudo chmod
commands on the internet. sudo
should be only used for system-wide administrative tasks (like adding a new user group to the system above) but not to modify a user’s folder. Make sure to run the chmod
and chgrp
commands as the owner of the folder.
Paths
I have a folder called /data
Paths beginning with a /
are absolute paths on Linux. If your folder does not reside in the root (/
) folder, make sure to put the right path in the above commands. The best way is to have the working directory set to the superfolder of data
(e.g. if the folder is /home/shared/data
, issue the command cd /home/shared
) and then use data
(without the leading /
) as the path argument.