Yes, you need read
permissions to execute script.
However, I want to mention one possibility for another_user
to run script without having r
permission on the file.
You can allow somebody to execute somescript
with sudo
as another_user that have an r+x
access to file.
However, you should have an access to /etc/sudoers
(i.e., to be root
, or ask superuser to add the record from below to etc/sudoers
)
# Run script as the user 'another_user' without asking for password
somebody ALL = (another_user) NOPASSWD: /usr/bin/somescript
Solution found at https://unix.stackexchange.com/a/77538 and https://stackoverflow.com/a/21309969/1566267