When something gives Permission denied, chmod 777 makes the error stop. It also gives every account on the computer rwx: they can read your secrets and change your programs. Do not use it.
1. The right owner and groupsudo chown OWNER:GROUP
2. The right accounts in the groupsudo usermod -aG GROUP NAME
3. The directoriesx to go in, w only where files are added
4. The filesr to read, w only for the owner, x only for programs
Give access to a group, not to everyone
Decide what each kind of account needs:
| Who | Needs | Gets it from |
|---|---|---|
till (the program) | Read the settings, write its data | The owner set |
staff (people) | Read the settings, add reports | The group set |
| All other accounts | Nothing | The last set: 0 |
The numbers for this example
| Path | Number | Why |
|---|---|---|
/srv/till | 750 | The owner and the group can go in. Others cannot |
/srv/till/till.conf | 640 | The owner changes it. The group reads it |
/srv/till/reports | 770 | The owner and the group can add files |
Check from the account that needs access
After the fix, check as that account. If the staff can read the settings and add a report, and the last set is 0 everywhere, the fix is done.