Skip to content

Instantly share code, notes, and snippets.

@GabrielMMelo
Created January 22, 2019 12:33
Show Gist options
  • Select an option

  • Save GabrielMMelo/0e146f32d73978bf0d0a06786bcbc96c to your computer and use it in GitHub Desktop.

Select an option

Save GabrielMMelo/0e146f32d73978bf0d0a06786bcbc96c to your computer and use it in GitHub Desktop.
Install sudo in Termux (Android)
apt install git
git clone https://gitlab.com/st42/termux-sudo
cd termux-sudo
cat sudo > /data/data/com.termux/files/usr/bin/sudo
chmod 700 /data/data/com.termux/files/usr/bin/sudo
@LeonGinger
Copy link

now this way is not work in Android15,my phone is install magisk-modules ,root and unlock bl,Android14/15, end if you can use "su" command,in temrmux you just need
cat > $PREFIX/bin/sudo << 'EOF' #!/system/bin/sh su -c "$@" EOF

chmod 755 $PREFIX/bin/sudo

and test
sudo id

.../ $ sudo id uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment