My phone is rooted CM7 and Superuser.apk has Connectbot in the allowed list. Titanium backup reports that it has root access, to prove that I actually have root working. I seem to remember being able to run commands in Connectbot as root in the past.

But now, I go into Connectbot → Local, and try to run a command using sudo, and it just says "permission denied". No pop-up or anything. Same for the Terminal Emulator app. How do I run commands as root?

1 Answer 1


The su binary works just like it does on Linux; it runs all commands that follow as root until you type exit (or terminate the process, etc.). sudo <command> essentially does:


Android doesn't normally include sudo, so If you wish to launch commands like you would with sudo, the syntax is as follows:

su -c "[command_1;command_2;...;command_N]"

For example, to get a list of installed packages in "root" mode, you can either do

$ su
# pm list packages
# ........ <listing of packages scrolls down> ......
# exit


$ su -c "pm list packages;exit"
  • Oh. If I use su by itself, it works. Connectbot is granted superuser permissions and then I can do stuff as root. Does sudo ever work, then?
    – endolith
    Commented Mar 26, 2012 at 15:06
  • 4
    Linux also have su binary.. so, don't say su as android equivalent of sudo.
    – iOS
    Commented Mar 26, 2012 at 16:02
  • 1
    sudo isn't installed on Android by default; sudo was written to give people the ability to access certain commands (via configuration) instead of using su to log in as root all the time. su is the more important command when you don't have uid 0 at all on your device.
    – Broam
    Commented Mar 26, 2012 at 16:54
  • 1
    @SachinShekhar Feel free to correct my answer with proper verbiage.
    – Chahk
    Commented Mar 26, 2012 at 17:23
  • 1
    wow! I didn't know -c was the tricky option to use. I just kept trying, say, "su logcat" and it never worked.
    – asgs
    Commented Sep 8, 2014 at 3:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .