Skip to content

fix: handle special characters in SSH password/passphrase (Fixes #312)#478

Merged
michelroegl-brunner merged 1 commit intomainfrom
fix/312
Jan 29, 2026
Merged

fix: handle special characters in SSH password/passphrase (Fixes #312)#478
michelroegl-brunner merged 1 commit intomainfrom
fix/312

Conversation

@michelroegl-brunner
Copy link
Member

Summary

Fixes #312 — script install fails when SSH password contains special characters (e.g. {).

Changes

  • transferScriptsFolder: Use sshpass -f with a temporary file instead of sshpass -p ${password} so the password/passphrase never goes through the shell. Temp file is created with mode 0600 and removed in close/error/catch.
  • testWithExpect: Pass password via SSH_PASSWORD env var and use $env(SSH_PASSWORD) in the expect script so the password is not embedded in the script string (safe for {, }, $, ", etc.).
  • ServerForm: Add hint when password auth is selected: SSH key recommended; special characters supported.

Testing

  • Passwords containing {, }, $, ", space, backslash work for script install and connection test.
  • Key auth (with/without passphrase) unchanged.

- Use sshpass -f with temp file in transferScriptsFolder so password/passphrase
  never go through shell; safe for {, $, ", etc.
- Pass password via SSH_PASSWORD env in testWithExpect instead of embedding
  in script
- Add ServerForm hint: SSH key recommended; special chars supported
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner January 29, 2026 14:18
@michelroegl-brunner michelroegl-brunner merged commit f33504b into main Jan 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with SSHPASS and or rsync

1 participant