How to hide password entry using stty
This scripts allow the user to type the password without it be shown in the screen.
Copy and past the content bellow in a .sh file
#!/bin/bash echo -n "Password: " stty -echo read PASSWD stty echo echo -e "\nYour password is:" $PASSWD
Running the shell script
# ./hiddenpasswd.sh Password: Your password is: t$prod123%f
Advertisement
Categories: Linux