Installing sudo on android
A guide on how to gain root priviledges on your android device
One of the great things about the Android OS is the freedom that the user has to customize and edit various configurations. In this article, I’ll be going over how you can install sudo in the Android terminal emulator Termux. By doing so, you effectively have root priviledges as you would on any other linux distro. One of the biggest reasons I wanted root priviledges was to access saved wifi keys on my device. It goes without mentioning that you can’t really view these keys using the UI and the same is true for iOS devices. So with that context in mind, let’s get right into it.
Note: Sudo only works on rooted devices so please make sure your device is rooted before following along with this guide
Install Termux
Go to your Playstore or Fdroid(recommended), search and install termux.
Open your termux console and follow these instructions:
The first thing you’ll want to do is update your source files and upgrade your packages
apt update && apt upgradeNext, install git if you don’t have it already
pkg install gitClone the sudo repository.(It used to be on github but was moved to gitlab. [after the Microsoft move I guess])
git clone https://gitlab.com/st42/termux-sudo.gitMove into the sudo directory and install the ncurses-utils library
cd termux-sudo && pkg install ncurses-utilsFinally write the content of the sudo file into your /data/ directory
cat sudo > /data/data/com.termux/files/usr/bin/sudo
# then...
chmod 700 /data/data/com.termux/files/usr/bin/sudoThen enjoy the new root priviledges
As an example, let’s check the saved wifi keys on our device
cd /data/misc/wifi/
# to view the saved keys, type..
cat wpa_supplicant.confThere you go, you should now be able to perform root operations on your android device. That being said, make sure you don’t tamper with any sensitive device files.
With great power comes great responsibility