Skip to content

Commit 0a00104

Browse files
Copilotigaw
andcommitted
fix: add SSH options to sftp to allow sshpass password auth
sftp -b - (batch mode) suppresses the interactive password prompt that sshpass relies on to inject the password. SSH then tried pubkey (failed) and a non-interactive password attempt (failed), giving: Permission denied (publickey,password). Connection closed. Fix: pass -o PubkeyAuthentication=no -o PreferredAuthentications=password to sftp so SSH skips pubkey entirely and goes straight to the password exchange, which sshpass -e can then satisfy from the SSHPASS env var. Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
1 parent e8cc256 commit 0a00104

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/upload.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ jobs:
8282
[ -f "$f" ] || continue
8383
echo "put $f $(basename "$f")"
8484
done
85-
) | sshpass -e sftp -b - "${SFTP_USERNAME}@${SFTP_SERVER}"
85+
) | sshpass -e sftp -b - \
86+
-o PubkeyAuthentication=no \
87+
-o PreferredAuthentications=password \
88+
"${SFTP_USERNAME}@${SFTP_SERVER}"
8689
8790
upload-release-assets:
8891
name: upload GitHub release assets

0 commit comments

Comments
 (0)