Does anyone know if it is possible to restrict execution of commands via dot slash notation for a directory?The environment is bash on Linux.For example, I have a directory /usr/local/app/bin. In /usr/local/app/bin is a command called foo. For some users I am creating an alias during login for foo that redirects foo elsewhere.I don't want those users to be able to run foo directly by cd'ing to /usr/local/app/bin and running:$ ./fooThese users need to be able to run other commands in /usr/local/app/bin but it doesn't matter if they are prevented from running these other commands via ./.In the end, my goal is to restrict certain users from executing foo interactively when logging on interactively.For example (roughly), in .bashrc:if [ -z $PS1 ]; then:elsealias foo=echo access denied!fiThis works except users can run foo directly using ./ from /usr/local/app/binThe file needs to be executable, but only when the full path is used. I'm hoping someone knows a clever way to accomplish this
How prevent users from running commands via dot slash for a directory?
linux;bash;command