I am having an issue running a program I just compiled. I am compiling it in a directory on my data drive formatted as ext4 set chmod a+rwx. g++ compiles it fine but when I go to run it tells me Permission denied even when trying with sudo but if copy it to anywhere on / it runs fine with desired results.
Here are the permissions of the program folder.
1 2 3 4 5
drwxrwxrwx 2 nobody nogroup 4096 Aug 7 23:36 .
drwxrwxrwx 7 root root 4096 Aug 7 10:26 ..
-rwxrw-rw- 1 nobody nogroup 529 Aug 7 10:42 main.cpp
-rwxrwxr-x 1 wunderbred wunderbred 13774 Aug 7 23:36 minmax
-rwxrw-rw- 1 nobody nogroup 393 Aug 7 10:30 minmax.h
Make sure you're running the correct minmax, type ./minmax. If that runs, type in "whence -v minmax to show you the version you might have been running before.
JLB is right: Double-check the permissions of the directory. It looks like the executable has the correct permissions for anyone to run it; however, the current directory is owned by nobody and its group is nogroup. Change those and see what happens.
ok so I changed directory ownereship with chown and it still didn't run and convinced it was something else because root didn't even have permission to run. I checked fstab and all 3 data drives were mounted with options users,default so I removed the users from all 3 remounted my drives and it ran, I even recompiled with original directory ownership and it still ran. I feel kinda stupid now.