1|shell@maguro:/ # ls -l /system/xbin/
-rwxr-xr-x root     shell       59816 2013-07-11 02:12 dexdump
-rwsr-sr-x root     root        67008 2013-10-08 17:24 su
shell@maguro:/ # ls /data
opendir failed, Permission denied

The permissions on su are correct right? I get the hash prompt, but I can't list the files in /data (or do anything that requires superuser permissions). I don't have Superuser.apk installed, I don't want to install it because of that grant/deny access dialogue that pops up if you wipe the device. What does Superuser.apk do that I can't do when I unpack the *.img files?

  • Perhaps you should install a file manager. I recommend CyanogenMod's. Also, SuperUser is the bridge between the su file and the application. AFAIK, you cannot create that connection yourself. – user24200 Oct 9 '13 at 0:27
  • if SuperUser can, so can I. I just need to know how. File manager won't help me, I need adb shell root access for more than browsing files. – MishaP Oct 9 '13 at 16:14
  • Perhaps we can help if you tell us what you want to do instead of giving us pieces at a time :) – user24200 Oct 10 '13 at 0:29
  • I need full root permissions to adb shell to run the android shell commands, add/remove/read files, and turn services on/off pragmatically for testing purposes. And although I know how to automate the UI, I need to do all of this without the UI in order to reduce the time that is required to initialize the device for testing. And I need to maintain ADB and root access after a factory reset. – MishaP Oct 10 '13 at 1:51
  • 1
    What version of Android are you using? Since 4.3 just having /system/xbin/su with suid root permissions is not enough, because there is additional protection using the capability bounding set (and maybe SELinux), which prevents the traditional way of su operation (you get the uid 0, but no privileges). You need to have a recent enough su and start su --daemon & during boot to get full root permissions (the latter is usually done by placing the command to start the daemon into /system/etc/install-recovery.sh). – Sergey Vlasov Oct 10 '13 at 7:48

For some operations, adb must be running as root as well.
You can easily restart the adb daemon with root permission by running adb root.
Then you can enter adb shell again, switch to root with su and navigate wherever you'd like.

Worked for me when I had exactly the same problem.
(Samsung Galaxy Nexus, Custom AOSP-based KitKat 4.4.4)

Small addition for others:
Certain superuser apps have an option in configuration to allow root access to either apps, adb or both. The default is not necessarily to allow adb root access.

  • 1
    The first point is true for ADB operations (such as adb push or adb pull), but not for shell operations AFAIK. Might be device/implementation specific, but I never had this issue: su && ls /data via adb shell worked on my devices even with the ADB daemon running in "normal mode". – Izzy Oct 29 '14 at 18:00

Enter su first.

> su
> ls /data

Make sure your device is rooted.

  • I do, and I get the hash prompt (#) but that's about the only thing that changes, I have regular user privileges, not super user privileges. – MishaP Oct 9 '13 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.