Permission denied on all of my code (in Linux)

cjohnson

Junior Member
Oct 10, 2002
21
0
0
Hey, on all of the code I've compiled in the last day or so I get 'permission denied' when I try to run it.. Here's an example:

cjohnson@gondor:~$ cat test.c
#include <stdio.h>

int main() {
printf("Blah\n");;
return 0;
}
cjohnson@gondor:~$ gcc test.c -o test
cjohnson@gondor:~$ ls -lh test
-rwxr-xr-x 1 cjohnson cjohnson 4.1K Jul 19 22:15 test
cjohnson@gondor:~$ ./test
bash: ./test: Permission denied
cjohnson@gondor:~$ file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
cjohnson@gondor:~$

Anyone have any idea what would cause this? My libs are all set to 644 for the perms, btw. I'm totally stumped and this is really bad... Thanks for any help.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
make the compiled file executable. chmod 0744 a.out (or anything that gives you execute permissions, but 744 will work).
 

cjohnson

Junior Member
Oct 10, 2002
21
0
0
Yeah, that's what it was. My /home was mounted noexec, fixed that and it works now. Thanks.