Preventing password leak and added password empty indicator
This commit is contained in:
parent
e31bee0db0
commit
a91c25cc08
1 changed files with 7 additions and 1 deletions
|
@ -333,12 +333,18 @@ function doSSHSetup() {
|
||||||
echo "Host: $SOSSSH_ENTRY_HOST"
|
echo "Host: $SOSSSH_ENTRY_HOST"
|
||||||
echo "Port: $SOSSSH_ENTRY_PORT"
|
echo "Port: $SOSSSH_ENTRY_PORT"
|
||||||
echo "Username: $SOSSSH_ENTRY_USERNAME"
|
echo "Username: $SOSSSH_ENTRY_USERNAME"
|
||||||
echo "Password: <censored>"
|
if [ "$SOSSSH_ENTRY_PASSWD" == "" ]; then
|
||||||
|
echo "Password:"
|
||||||
|
else
|
||||||
|
echo "Password: <censored>"
|
||||||
|
fi
|
||||||
echo -n "Is this information correct [y/N]? "
|
echo -n "Is this information correct [y/N]? "
|
||||||
read -r SOSSSH_ENTRY_CONFIRMATION
|
read -r SOSSSH_ENTRY_CONFIRMATION
|
||||||
if [ "$SOSSSH_ENTRY_CONFIRMATION" == "y" ] || [ "$SOSSSH_ENTRY_CONFIRMATION" == "Y" ]; then
|
if [ "$SOSSSH_ENTRY_CONFIRMATION" == "y" ] || [ "$SOSSSH_ENTRY_CONFIRMATION" == "Y" ]; then
|
||||||
|
export "SOSSSH_ENTRY_PASSWD="
|
||||||
echo -e "# This file has been generated by sos-ssh by using setup\nSOSSSH_HOST=$SOSSSH_ENTRY_HOST\nSOSSSH_PORT=$SOSSSH_ENTRY_PORT\nSOSSSH_USERNAME=$SOSSSH_ENTRY_USERNAME\nSOSSSH_PASSWD=$SOSSSH_ENTRY_PASSWD" &> "$HOME/.sostools/ssh/sos-ssh.conf.d/sshsetup.conf"
|
echo -e "# This file has been generated by sos-ssh by using setup\nSOSSSH_HOST=$SOSSSH_ENTRY_HOST\nSOSSSH_PORT=$SOSSSH_ENTRY_PORT\nSOSSSH_USERNAME=$SOSSSH_ENTRY_USERNAME\nSOSSSH_PASSWD=$SOSSSH_ENTRY_PASSWD" &> "$HOME/.sostools/ssh/sos-ssh.conf.d/sshsetup.conf"
|
||||||
else
|
else
|
||||||
|
export "SOSSSH_ENTRY_PASSWD="
|
||||||
echo "Cancelled."
|
echo "Cancelled."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue