How to install sudo and run termux as #root

0
354

Hiii Guys,

A lot of guyz are confuse how to use sudo for some of tools like Xerosploit etc .

So this script will provide you sudo access to the termux

Termux-sudo is a bash script which is used to provide sudo access to the terminal emulator, linux environment on android and termux.

Note:

This script was hosted to github and due to microsoft owned the github developer transferred it to gitlab.

Requirements:

  1. Termux installed
  2. Root access , rooted phone with su binaries.

Installing sudo in termux

Steps:

  1. apt update && apt upgrade
  2. apt install git

Install a dependency needed for sudo:

  • pkg install ncurses-utils
  • cd $home && git clone https://gitlab.com/st42/termux-sudo

Then type

  • cd termux-sudo

And after that

  • cat sudo > /data/data/com.termux/files/usr/bin/sudo

And finally

  • chmod 700 /data/data/com.termux/files/usr/bin/sudo

Features:

  • Sets up its environment automatically on first run, no need to do anything but use it
  • Creates a root folder .suroot in the Termux home folder with proper root permissions and ownership
  • Creates .bashrc file in root folder with proper PATH and LD_LIBRARY_PATH variables set so all binaries function correctly
  • Bash prompt PS1 variable is also set so you don't have bash-4.4# as prompt just #
  • Automatically creates .bash_history in root folder when you drop to a root shell so root shell history is preserved
  • Can be used like ordinary sudo (but only as root, no other user)
  • Can drop to root shell sudo su [-]
  • Runs built in Termux binaries and exteral binaries with optional arguments as root in current directory
  • Generates output in shell currently using
  • Can be used in other bash scripts
  • [option] Can turn off colored error messages be editing the variable colored at the beginning of sudo file
Usage:
sudo su [-]  
Drop to root shell

Thanks for reading

LEAVE A REPLY

Please enter your comment!
Please enter your name here