5

I have a rooted tablet that gives adb root as soon as it connects.

When I type adb shell I get root@android:/#

I can do su and it's not showing me any permissions errors

But when I try to execute a file on an sdcard that has already been given all permissions. I get Permission Denied

Why is this happening?

1
  • Maybe try rebooting the device... or executing adb root. Commented Jul 10, 2012 at 14:23

1 Answer 1

8

The sdcard is mounted with a noexec flag, which means you cannot execute things stored there.

This is doubly important when running as root or even the semi privileged shell, since the lack of file permissions or ownership there means any userid with the write external storage permission could trojanize the program you might want to run.

As an aside the default shell has a limited vocabulary of errors and in many versions will also say permission denied as a substitute for command not found. Your current working directory is not in the search path, so if you want to run something from there, you typically need to do:

./filename 
4
  • I have the same problem, and is unrelated to your answer. First, I get this error randomly. Sencond, my adb runs in a local HD, and even after cd to the directory platform-tools, running ./adb as root gives me "permission denied". No adb is running, and everything has permissions 777... IMO, this is an adb bug. Commented Nov 6, 2012 at 15:28
  • @LuisA.Florit you seem to be having a permission problem on the development machine, which is an entirely different question from the one asked on this page, which concerns permissions of programs executed on the device, such as from a shell communicating through adb. Commented Nov 6, 2012 at 16:40
  • Regarding my issue, which "permission problem on the development machine" could be that does not allow me to execute a file as root, and with 777 permission?? And randomly? Even as a normal user I can create files in the platform tools dir, but cannot execute an executable as root! AFAIK, this is impossible in Linux with a healthy program. Actually, I gooled this and is a common problem. ADB bug, IMO. But I understand that the OP can have a different problem than me. Commented Nov 6, 2012 at 23:43
  • Your comment is off topic here as it is entirely unrelated, please search for questions on ADB install problems and if nothing matches make your own. Commented Nov 6, 2012 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.