Send the password through stdin in `ssh-copy-id`
You might want to try installing sshpass, and altering your call to ssh-copy-id
:
sshpass -p "$TMP_PASS" ssh-copy-id
Where did you find the information about -S
option? It does something completely different! It is used for multiplexing and ControlPath.
SSH will not accept passwords on stdin ever, so you should pre-install authorized keys in your deployment (preferred way) or use sshpass
or expect
script as described in many other questions.