I am trying to do some security levels on my linux system. For example, deny access to ping command or disk utility application can be easly done by restricting permissions to 750 for binaries:
/bin/ping
/usr/bin/gnome-disks
and a user won't be able to run them. But the problem is that user can somehow obtain the same binary from outside and place that binary in it's home folder. Because user cannot be stopped from grantng permissions to it's own files, he can run the binary files and avoid the permissions granted on system files.
How can I stop user from doing it?
ping
in particular needs to be setuid root to run, so forping
you're covered. But for binaries that don't need any particular privileges, you're just wasting your time. You shouldn't try to solve human problems with technical restrictions. – Satō Katsura Oct 04 '17 at 10:43$HOME
with thenoexec
option can be easily bypassed on Linux. – Satō Katsura Oct 04 '17 at 10:58