Here is a good way to set up users and groups with permissions on FreeNAS. This how-to assumes that you have the FreeNAS server set up properly and that you have mounted your various drives’ and set up the directories you need. Start by creating your own user account and joining it to the ‘wheel’ group. You should be the only user in that group.
In this example I am going to create a user that can access the ‘NAS_downloads’ directory with read/write/execute permissions (rwx) that is owned by ‘root’ and which the public has no access to. Go into the FreeNAS web browser and create the group ‘media’ and add your media user to it. Next, we are going to give ‘root’ ownership of all files on our ‘/mnt ‘ drives:
- Open a terminal using Putty and ssh into the freeNAS server.
- Enter the following commands into the terminal:
# cd /your_drive
# chown -R root:wheel . - If you have more than 1 drive in your FreeNAS server (I have 5) then repeat the previous command for each drive.
- Change to your media directory:
# cd / NAS_downloads - Execute the command:
# chmod -R 775
Now you are finished. Your ‘Media’ user only has read/write access to the NAS_downloads directory while you have all access to everything. You can create other users as needed by repeating the command steps on the new directories. There is a good permissions calculator here.
Create a group (or put those users in a unique group that already exists) and chown the folder so that that group has ownership permissions:
chown -R owner-user file
chown -R owner-user:owner-group file
chown -R owner-user:owner-group directory
chown -R options owner-user:owner-group file
-R – Recursively change ownership of directories and their contents.
Example: chown -R tgiweb:wheel TGI3
Then you need to used the chmod command to change file and directory permissions:
There is a good calculator at: http://www.onlineconversion.com/html_chmod_calculator.htm
If you are using Samba with windows you should set the execute bit also.
Here is an example: chmod -R 771 Audition_Dropoff/TGJ2O
Is their a way to set up a group of users that only have permissions to their folder and cant go back and get back to other folders?