fix: handle special characters in SSH password/passphrase (Fixes #312)#478
Merged
michelroegl-brunner merged 1 commit intomainfrom Jan 29, 2026
Merged
fix: handle special characters in SSH password/passphrase (Fixes #312)#478michelroegl-brunner merged 1 commit intomainfrom
michelroegl-brunner merged 1 commit intomainfrom
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #312 — script install fails when SSH password contains special characters (e.g.
{).Changes
sshpass -fwith a temporary file instead ofsshpass -p ${password}so the password/passphrase never goes through the shell. Temp file is created with mode 0600 and removed inclose/error/catch.SSH_PASSWORDenv var and use$env(SSH_PASSWORD)in the expect script so the password is not embedded in the script string (safe for{,},$,", etc.).Testing
{,},$,", space, backslash work for script install and connection test.