Closed anthony-grasso-datastax closed 2 years ago
related: see escape_special_chars()
bash function which got dummied out. We used to escape, but we stopped because it was causing problems.
Hilton and I ran into this issue today and we fixed it by placing escaped quotes around the password passed to sshpass
.
The fix would be a simple one-line change
ssh_command="sshpass -p \"$sshPassword\" $ssh_command"
Note, we tested this fix on a production cluster.
There's a better solution to this though: put the password in the environment SSHPASS
and use -e
, rather than passing on the command line with -p
.
https://github.com/datastax/diagnostic-collection/pull/140 should address this.
Works for me!
If an SSH password contains special characters such as a
;
(semicolon) thensshpass
will fail.This is easily fixed by escaping the password passed to
sshpass
.