我收到错误
extra characters after close-quote
while executing
"spawn ssh-add <(echo -e "-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,2AB77A7C6E344A120BA00670A3CAB833
AM57TuHYLo..."
使用expect和spawn添加带密码的ssh密钥时。 这是我的剧本:
eval $(ssh-agent -s)
expect -c "spawn ssh-add <(echo -e \"$SSH_PRIVATE_KEY\\r\"); expect \"Enter passphrase\"; send \"$SSH_PASSPHRASE\\r\"; expect eof;"
在回显ssh私钥时我也尝试了很多组合:
echo "$SSH_PRIVATE_KEY"
echo \"$SSH_PRIVATE_KEY\"
echo -e \"$SSH_PRIVATE_KEY\"
echo '$SSH_PRIVATE_KEY'
echo '$SSH_PRIVATE_KEY'