I need to automate some identity deployments, ideally using ssh-copy-id.
I'm trying to provide the password through stdin, which is possible on ssh by using the -S flag. I'm aware that I can send additional options to ssh using the -o flag in the ssh-copy-id command however there's no usage examples of this flag in the man page.
So I've tried to pass the SSH password for ssh-copy-id through stdin using:
$# echo $TMP_PASS | ssh-copy-id -p2222 -i key.pub user@host -o "-S"
But all I get is:
/bin/ssh-copy-id: ERROR: command-line: line 0: Bad configuration option: -s
EDIT:
I'm trying to provide the password through stdin, which is possible on
sshby using the-Sflag.
This statement is wrong. I've actually read this flag from sudo man;
brew installis attempted, i get "Error: No available formula with the name "sshpass" We won't add sshpass because it makes it too easy for novice SSH users to ruin SSH's security." – tofutim Apr 13 '18 at 19:26