Search code examples
ubuntupermissionsfile-permissionssudouser-permissions

Cannot execute owned file on Ubuntu 14.04 LTS


I have a file I need to execute as userme. The following command runs just fine:

# sudo /usr/lib/squid3/squid_radius_auth -f /etc/squid3/radius-config

However, when I run as userme, it gives the following error:

# sudo -u userme /usr/lib/squid3/squid_radius_auth -f /etc/squid3/radius-config
sudo: unable to execute /usr/lib/squid3/squid_radius_auth: Permission denied

I have tried these:

# sudo chown userme:userme /usr/lib/squid3/squid_radius_auth
# sudo chmod 777 /usr/lib/squid3/squid_radius_auth
# sudo chmod +x /usr/lib/squid3/squid_radius_auth

but this doesn't work. I just cant get it to run as non-root.


Solution

  • Found the answer here:

    It is not enough to have read permission on a file in order to read it. You also need to have read permission on the directory it belongs to.

    The solution here was:

    chmod 775 /usr/lib/squid3/