From a91c25cc081045c0212b7e022ccd279c911eefda Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 15 Aug 2022 13:50:35 +0200 Subject: [PATCH] Preventing password leak and added password empty indicator --- sos-ssh.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sos-ssh.sh b/sos-ssh.sh index 0356a4e..2d5a924 100755 --- a/sos-ssh.sh +++ b/sos-ssh.sh @@ -333,12 +333,18 @@ function doSSHSetup() { echo "Host: $SOSSSH_ENTRY_HOST" echo "Port: $SOSSSH_ENTRY_PORT" echo "Username: $SOSSSH_ENTRY_USERNAME" - echo "Password: " + if [ "$SOSSSH_ENTRY_PASSWD" == "" ]; then + echo "Password:" + else + echo "Password: " + fi echo -n "Is this information correct [y/N]? " read -r SOSSSH_ENTRY_CONFIRMATION 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" else + export "SOSSSH_ENTRY_PASSWD=" echo "Cancelled." fi }