For the purpose of this question let’s attempt to deny user
n the ability to play The Battle for Wesnoth (while still allowing users
p to do so).
One obvious way to try to do this is to set permissions of relevant files (
/usr/games/wesnoth* and the directory
/usr/share/games/wesnoth) so that user
n can neither execute them nor read them, while other users can.
As of now, the permissions of these files seem to be set as follows:
$ ls -l /usr/games/wesnoth-1.12 -rwxr-xr-x 1 root root 18325576 May 22 2016 /usr/games/wesnoth-1.12
Well, I’d suppose changing the ownership from user
root to someone else wouldn’t be a good idea, so it’d seem I’ll have to mess with the group ownership instead…
I have basically two ideas:
‘Blacklisting’: Give the game’s files group
noplay, and prohibit anyone with group
noplay from using them:
sudo addgroup noplay sudo adduser n noplay sudo chown :noplay /usr/games/wesnoth* /usr/share/games/wesnoth sudo chmod g-rx /usr/games/wesnoth* /usr/share/games/wesnoth
‘Whitelisting’: Give the game’s file group
play, and prohibit others from using using them:
sudo addgroup play sudo adduser m play sudo adduser p play sudo chown :play /usr/games/wesnoth* /usr/share/games/wesnoth sudo chmod o-rx /usr/games/wesnoth* /urs/share/games/wesnoth
Is any of the above a good idea? Won’t changing the files’ group ownership from
root to anything else make things awkward in the future? What if the game gets updated by the package manager – will it fail because of screwed permissions, or will it reset the permissions back to original, thus allowing all users to play the game?
If this matters, it’s Linux Mint here.