-1

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.

gunwin
  • 4,578
  • 5
  • 37
  • 59

1 Answers1

-1

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/
Community
  • 1
  • 1
gunwin
  • 4,578
  • 5
  • 37
  • 59
  • 1
    *No no no.* Making a system resource world-writable is a **terrible** idea. You should immediately revert to sane permissions (perhaps `chmod 755 /usr/lib/squid3`) and take it from there. – tripleee Mar 17 '17 at 09:58
  • 1
    Updated to be more sensible. – gunwin Apr 01 '17 at 21:57