access denied in Linux

tj107us1

In Runtime
Messages
332
Location
USA
Hey guys, when I write a C program and store it on my USB thumb drive and I use the Terminal to compile the code. When I try to run it using (./name of exe.) it tells me access denied, but if I copy and paste to the root dir or desktop It runs it no problem. Does anyone have any idea whats going on, why I can complie it but can't run it on any other drive!!

thanks for any help,
tj
 
Try the following while the harddrive is connected:

  • Open a command prompt and sudo to root (sudo bash)
  • chmod 777 /media/"usbname"

This will set the permission of the root-Directory of the external harddrive - e.g. it does not touch any of the other files. If you want to set it for all files:


  • chmod -R 777 /media/"usbname"
 
The second command you have specified will recursively set the entire contents of the harddrive, including all sub directories and contained files. That's what the -R does.
 
Back
Top Bottom