Termux-Login is a security script for Termux that adds an authentication layer before granting access to the Termux shell. The script prompts the user for fingerprint authentication up to three times and, upon failure, requests a password. If authentication fails, it logs the attempt and takes photos of the intruder using the device's cameras.
- Fingerprint authentication (via
termux-fingerprint) - Password authentication (SHA-256 hash comparison)
- Intruder detection
- Logs unauthorized login attempts
- Captures photos from both front and back cameras
- Sends a notification alert
- Automatic logging of login attempts
- Security notifications with vibration and sound alerts
Warning
The script may not function properly (e.g., fail to take photos) on devices without a front camera.
Ensure you have Termux and Termux API installed:
pkg update && pkg upgrade
pkg install termux-api
termux-api-startCaution
Termux API is required for this script to function properly. Without a properly installed and configured Termux API, the script will not work and will lock Termux.
You can download Termux API from F-Droid: click here
Note
Both applications (Termux and Termux:API) must come from the same source.
- Clone the repository:
git clone https://github.com/BuriXon-code/termux-login.git
- Move the script to the required location:
mv termux-login/termux-login.sh $PREFIX/etc/termux-login.sh - Grant execution permission:
chmod +x $PREFIX/etc/termux-login.sh - Set up the expected SHA-256 password:
- Generate the SHA-256 hash of your password:
echo -n "your_password" | sha256sum
- Edit
termux-login.shand replacepassword-sha256with the generated hash.
- Generate the SHA-256 hash of your password:
Once installed, the script will execute automatically when Termux starts.
- The script prompts for fingerprint authentication (max 3 attempts).
- If fingerprint authentication fails, it requests a password.
- Upon failed authentication:
- Logs the failed attempt
- Captures photos of the intruder
- Sends a high-priority notification alert
- Kills the Termux process to prevent unauthorized access
Logs are stored in:
/data/data/com.termux/files/home/.login_logs/logs.txt
Intruder photos are stored in:
/data/data/com.termux/files/home/.login_logs/intruders/
For any issues, suggestions, or questions, reach out via:
- Email: support@burixon.dev
- Contact form: Click here
- Bug reports: Click here
If you find this script useful, consider supporting my work by making a donation:
Your contributions help in developing new projects and improving existing tools!


