Created
March 21, 2019 08:12
-
-
Save matthiasbalke/f0abe1e6c18704f086389009075c645e to your computer and use it in GitHub Desktop.
add ssh key non-interactive using expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
# https://unix.stackexchange.com/a/90869/91094 | |
spawn ssh-add /home/user/.ssh/id_rsa | |
expect "Enter passphrase for /home/user/.ssh/id_rsa:" | |
send "passphrase\n"; | |
expect "Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa)" | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment