How would I go about not allowing none-administrative users from using applications that I don't them to? I'm new to configuration files so please give me step-by-step instructions so that I don't screw up my machine by accident.
1 Answer
If a program is shared in /usr/share, then all users have rights to execute them. A simple way of restricting other users from executing these files, without uninstalling and reinstalling, is by changing the access permissions.
Run this line of code, replace program with the name of the program you wish to restrict permissions. (Replace /usr/share with the actual location if the file you are restricting isn't in the share file.)
$ ls -al /usr/share | grep program
Out put is going to be something like
drwxr-xr-x 3 ben adm 102B Feb 12 23:11 program
In my case, the file is readable and executable by every user, the owner is me (ben), and it belongs to the group adm(administrators).
We want the files group to be something that only the admins can access. Use a group that all admins are in (such as adm), and change it using:
# chown :adm /usr/share/program
Next we wanna change it to only be readable and executable by the owner and the group.
# chmod 750 /usr/share/program
That will change the permissions to drwxr-x---
Success!
That should do the trick. Test it out and lemme know if it doesn't work?!?!
Also, here's how permissions work on files https://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions Hope that's useful for the future.
-
every folder in /usr/share is already owned by root. This explanation is garbage. Aug 14, 2021 at 10:48