Created
June 19, 2013 18:22
-
-
Save calib0rx/5816603 to your computer and use it in GitHub Desktop.
Protect your command line passwords
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pwcmd () { | |
echo -ne "\nEnter the password for the command\n>> "; | |
stty -echo; | |
read PASS; | |
stty echo; | |
echo -ne "\nEnter command with $PASS where you would type the password\n>> "; | |
read USRCMD; | |
eval $USRCMD; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment