Skip to content

Instantly share code, notes, and snippets.

@dargmuesli
Last active September 9, 2021 04:26
Show Gist options
  • Save dargmuesli/33f6bdee03841122eca536924bf3bbc0 to your computer and use it in GitHub Desktop.
Save dargmuesli/33f6bdee03841122eca536924bf3bbc0 to your computer and use it in GitHub Desktop.
Add ssh keys with expect.
#!/usr/bin/expect -f
spawn ssh-add $env(HOME)/.ssh/id_ed25519
expect "Enter passphrase for $env(HOME)/.ssh/id_ed25519:"
send "$env(SSH_PASSPHRASE)\n"
expect "Identity added: /home/elements/.ssh/id_ed25519*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment