0

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-

  1. Is it necessary that an C program must reside on EXT partition?
  2. Is there any command that will grant the permission?
  3. Does it need .exe for NTFS or FAT and if so can it be executed in Terminal?
T3J45
  • 176
  • 2
  • 11
  • Moreover, sometime pluggable devices are mounted explicitly noexec (and nosuid, nodev) for safety reasons. Although it seems that lately it's not the case anymore... – Rmano Feb 25 '15 at 17:47
  • No @muru , I checked the output file's permission it belongs to me (Command ls -l). Later I tried it by giving it to root still no success! – T3J45 Feb 25 '15 at 18:25
  • What does that have to do with anything? – muru Feb 25 '15 at 18:27

0 Answers0