Basically this is the same thing as one of the very famous UNIX technical interview questions, known for ages:
Assume someone with root access ran a command
chmod -R 444 / and made the
chmod binary non-executable. How do you recover from it ?
There is a perl answer and there is this one, which basically is running a non-executable program,
chmod in this case:
/lib/ld-linux.so /bin/chmod +x /bin/chmod
I think you can apply it to any other program that you know is executable. Otherwise be ready to embrace the disaster, which may ensue
/lib/ld-linux.so might differ in name. So if the direct match is not available, look around for similarly named
so's. For instance on my CentOS 6 server, it is
/lib/ld-linux.so.2 which is a symlink pointing to
/lib/ld-2.12.so. So, your mileage may vary.
sudo <program>- see
chmod, same result when the exec bits are unset. Perhaps this behaviour is controlled by a
-rwxrwxr-- root root 86 Feb 25 21:44 testin
doedoesn't have execute permission for this, but can run it with
sudo test. Or have I misread the question?