HostSocket Shell is a interactive PTY-backed shell over a UNIX socket for Android devices.
It supports both root and non-root (shell) users.
This is designed to be run via a KernelSU module or similar privileged service.
Created mainlly to have access to andorid shell form isolated container running on android (Droidspaces ).
- PTY-backed shell with full job control (hmm... has some issues)
- Supports root and non-root users
- Auto-reconnect wrapper for stability
- Minimal dependencies (works on Alpine and other minimal containers)
- Logs daemon activity for debugging
This module exposes a UNIX socket that can provide root shell access to the host system.
- Any process with access to the socket may gain elevated privileges
- Mounting
/datainto containers effectively exposes this interface - Misconfiguration can lead to full device compromise
Be responsible and use this only in trusted environments and at your on risk.
- Copy the module folder to
/data/adb/modules/hostsocket(or equivalent path for KernelSU). - Ensure
service.shanddaemon.share executable:
or
Install module file on your root solutions
chmod +x service.sh daemon.sh bin/socat- Enable the module via KernelSU manager and reboot or start service manually:
/data/adb/modules/hostsocket/service.shNote: The
socatbinary included inbin/is provided courtesy of static-toolbox.
# User shell (default)
./socket-shell.sh
# Root shell
./socket-shell.sh root
# Custom socket path
./socket-shell.sh /media/DataHost/local/host.user.sock- Exit: Press
Ctrl+Cto quit immediately, or typeexitinside the shell to close the connection. - Reconnect: Wrapper will prompt for reconnect if the connection drops unexpectedly.
- CWD & PATH: The initial working directory and PATH can be configured inside
daemon.shper socket.
hostsocket/
├── bin/
│ └── socat # prebuilt static socat binary (from static-toolbox)
├── daemon.sh # kernel service socket daemon
├── service.sh # watchdog + daemon launcher
├── socket-shell.sh # client wrapper with reconnect
├── module.prop # KernelSU module metadata and status
└── README.md
- Android device with KernelSU or Magisk-like module support
- socat binary with PTY support (included in
bin/for convenience, credit: static-toolbox) - Minimal shell environment (busybox sh works)
- Non-root shell uses UID 2000 (
shell) for safety - Root shell has full system access — use responsibly
- Minimal Alpine containers may require a prebuilt socat binary for full PTY support
- Logs are written to
/data/local/hostsocket_watchdog.logby default
MIT License