Skip to content

Commit

Permalink
fix: catch key passprhase
Browse files Browse the repository at this point in the history
  • Loading branch information
DakEnviy committed Jul 24, 2022
1 parent 691bffc commit 2225451
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sshp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ connect() {
echo -n "$pass" | xclip -selection clipboard
fi

sshpass -p "$pass" ssh "${ssh_params[@]}" "$dest"
# If ident file is provided connect without sshpass to catch key passphrase if needed
if [[ -n "$ident_filepath" ]]; then
ssh "${ssh_params[@]}" "$dest"
else
sshpass -p "$pass" ssh "${ssh_params[@]}" "$dest"
fi
}

case "$1" in
Expand Down

0 comments on commit 2225451

Please sign in to comment.