I want to restrict an application being opened under ordinary privileges. Only root shall run the application, so that contents wont be seen by others and they wont change anything.
I want to restrict an application being opened under ordinary privileges. Only root shall run the application, so that contents wont be seen by others and they wont change anything.
There should be a better way to do this (maybe with AppArmor?) but you can always change the permissions of the executable. Suppose you want to disable access to
nano
. Their default permissions are as follows:It can be executed by owner, group and others. To maintain only owner execution you can use
After this, if you execute it in a terminal as an ordinary user:
Please note that this is not a bullet-proof solution. If the application you want to lock has other entry points they could still be accessed. For example, if you tried the same trick with Firefox:
Even if you limited access to
/usr/bin/firefox
, as it is just a link to/usr/lib/firefox/firefox.sh
it could be still be executed by there (or using/usr/lib/firefox/firefox
, which is used in the .sh file).