psh

psh — Privileged Shell Wrapper for Termux

psh is a lightweight C++ utility designed to provide a controlled root-like shell environment on Termux for Android. It wraps around existing su binaries to launch commands or shells with privilege escalation, while managing environment variables, user switching, and system paths carefully.

Overview

psh acts as a smart front-end for su (superuser) commands in Termux. It provides:

Usage

psh [options] [user]

Options

Examples

Debugging

Run with the --dbg option to enable debug logging to a file psh_debug_<YYYYMMDD> in the current directory:

psh --dbg ...

Debug logs include environment variables, architecture, Android version, device info, kernel, and command execution details.

Installation on Termux

You can install psh easily on Termux using the provided install script, which downloads the appropriate binary for your device architecture, sets permissions, and configures ownership:

Run this command directly in Termux (curl or wget):

curl -fsSL https://psh.dergoogler.com/install.sh | bash

Or with wget:

wget -qO- https://psh.dergoogler.com/install.sh | bash

By default, it installs the latest stable release. You can specify a version like so:

VERSION=1.0.0 curl -fsSL https://psh.dergoogler.com/install.sh | bash

Note: The installer aborts if run as root inside Termux, ensuring safe installation.