I´m getting crazy trying to make this works.
I need to use expect to set a couple passwords. The problem that I have is that I have to run two commands in the same processor.
Here the code
yum install -y expect
secret="price_aws_git_secret.txt"
eval $(ssh-agent)
pass=$(cat $secret)
expect << EOF
spawn ssh-agent ssh-add price_aws_github
expect "Enter passphrase"
send "$pass\r"
spawn git clone git@github/repo.git
expect "Are you sure you want to continue connecting"
send "yes\r"
expect eof
EOF
The first command add into the ssh-agent the ssh key, and the second command the git clone need to be in the same process to get that agent.
Looking documentation and examples I´m not able to see how expect can works with two commands in the same process.
Any suggestion?
Thanks!
expectaltogether by setting up public-key authentication instead.