ssh-add from bash script and automate passphrase entry
问题 I am trying to do ssh-add from script (don't care about about security at the moment). Now ssh prompts for passphrase, which needs to be automated, so i read couple of things like this and found expect. And now i do following: eval `ssh-agent -s` script tmp.sh defined as : #!/usr/bin/expect spawn ssh-add /root/.ssh/id_rsa expect "Enter passphrase for /root/.ssh/id_rsa:" send "my_pass" interact ./tmp.sh ssh-add -l If ssh-add would have worked it shows something like 4096 SHA256:wlfP