Skip to content

Commit

Permalink
Merge pull request #16 from grodriguezl/patch-1
Browse files Browse the repository at this point in the history
Fix some passphrase errors in exec and copy
  • Loading branch information
ltamaster authored Sep 1, 2020
2 parents 3e878e2 + d9be8b9 commit 8a77952
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contents/ssh-copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ if [[ "privatekey" == "$authentication" ]] ; then
if [[ -n "${!rd_secure_passphrase}" ]]; then
mkdir -p "/tmp/.ssh-exec"
SSH_KEY_PASSPHRASE_STORAGE_PATH=$(mktemp "/tmp/.ssh-exec/ssh-passfile.$USER@$HOST.XXXXX")
echo "${!rd_secure_passphrase}" > "$SSH_PASS_STORAGE_PATH"
echo "${!rd_secure_passphrase}" > "$SSH_KEY_PASSPHRASE_STORAGE_PATH"

RUNSSH="sshpass -P passphrase -f $SSH_KEY_PASSPHRASE_STORAGE_PATH ssh $SSHOPTS $USER@$HOST $CMD"
RUNSCP="sshpass -P passphrase -f $SSH_KEY_PASSPHRASE_STORAGE_PATH scp $SSHOPTS $FILE $USER@$HOST:$DIR"

trap 'rm "$SSH_KEY_PASSPHRASE_STORAGE_PATH"' EXIT
fi
Expand Down
2 changes: 1 addition & 1 deletion contents/ssh-exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if [[ "privatekey" == "$authentication" ]] ; then
if [[ -n "${!rd_secure_passphrase}" ]]; then
mkdir -p "/tmp/.ssh-exec"
SSH_KEY_PASSPHRASE_STORAGE_PATH=$(mktemp "/tmp/.ssh-exec/ssh-passfile.$USER@$HOST.XXXXX")
echo "${!rd_secure_passphrase}" > "$SSH_PASS_STORAGE_PATH"
echo "${!rd_secure_passphrase}" > "$SSH_KEY_PASSPHRASE_STORAGE_PATH"

RUNSSH="sshpass -P passphrase -f $SSH_KEY_PASSPHRASE_STORAGE_PATH ssh $SSHOPTS $USER@$HOST $CMD"

Expand Down

0 comments on commit 8a77952

Please sign in to comment.