A secure login system for Termux that protects access using encrypted credentials, login tracking, and emergency bypass support. Designed with security and flexibility in mind.
-
User credentials are stored securely.
-
Passwords are hashed using SHA-256 via openssl before saving or checking.
-
Ensures credentials cannot be read directly from the storage file.
-
If you forget your credentials, entering a predefined emergency username will bypass the lock.
-
This username is also stored and compared securely using hashing.
-
Helps in recovery without needing to delete the script manually.
-
All login attempts are logged in login.log.
-
Each entry includes:
-
Timestamp
-
Input username
-
Result (Success or Failed)
-
-
Helps track unauthorized or failed login attempts.
-
Displays a stylized terminal banner at login using figlet.
-
Makes the login prompt visually distinct and stylish.
-
Enhances branding or personalization.
Prevents bypassing the login screen using keyboard interrupts like:
-
Ensures the login script can’t be force-terminated by the user.
Ctrl+C (SIGINT)CTRL+V (SIGTSTP)
-
Main login handled by login.sh
-
Credential management handled by change-creds.sh
-
Keeps code organized and easier to maintain or upgrade.
git clone https://github.com/VizXtreme/termux-securize && cd termux-securizepkg update && pkg install openssl openssl-tool figlet -ymkdir -p ~/.termux-logincp login.sh change-creds.sh setup-creds.sh ~/.termux-login/
chmod +x ~/.termux-login/*.sh && cdAppend this line at the top of ~/.bashrc:
[ -f "$HOME/.termux-login/login.sh" ] && bash "$HOME/.termux-login/login.sh"
clear
bash motd.shNote: Restart Termux or run
source ~/.bashrcto test.
Run the credential changer script:
bash ~/.termux-login/setup-creds.shFollow the prompt to set a new username and password. Your password will be hashed using SHA-256 and stored securely in ~/.termux-login/creds.txt.
If you forget your credentials, enter your emergency username (hashed internally) to unlock access.
Refer to Emergency Bypass to set it up.
creds.txt contains:
USERNAME (plain)
PASSWORD_HASH (SHA256)
All login attempts are saved in:
~/.termux-login/login.logWith timestamps, success/failure status, and the user entered.
Feel free to contribute or suggest improvements via issues.