So lately I've been in C programming. On trial and Error and Basis I tried Compiling(GCC) and Executing(./a.out) from my Windows' partition and Pen-drive i.e. precisely I tried executing on NTFS and FAT. I'm currently using Ubuntu 14.04(32bit) and executing via Terminal.
PROBLEM:- When I tried executing C program in Terminal (in Pendrive), It returns a following error
bash: ./a.out: Permission denied
Here's what I tried:
(1)WITHOUT ROOT-
tj@tj-HP-Pavilion-dv4-Notebook-PC:/media/tj/HP/TJbin$ gcc phil.c -pthread -o dine
tj@tj-HP-Pavilion-dv4-Notebook-PC:/media/tj/HP/TJbin$ ./dine
bash: ./dine: Permission denied
(2)WITH ROOT-
root@tj-HP-Pavilion-dv4-Notebook-PC:/media/tj/HP/TJbin# gcc phil.c -pthread -o dine
root@tj-HP-Pavilion-dv4-Notebook-PC:/media/tj/HP/TJbin# ./dine
bash: ./dine: Permission denied
Explanation- Since without root, it returned an error "Permission denied"; I tried it with root, but no success.
Question-
- Is it necessary that an C program must reside on EXT partition?
- Is there any command that will grant the permission?
- Does it need .exe for NTFS or FAT and if so can it be executed in Terminal?
noexec(andnosuid, nodev) for safety reasons. Although it seems that lately it's not the case anymore... – Rmano Feb 25 '15 at 17:47