genesis/wordpress — pull request #131 by EvanK (2014-06-25 16:26:43+00:00)
Title: genesis:provision should setup password-less SSH

Because Capistrano ~2.15 has issues with password authentication, I think the best course is for `genesis:provision -S user=... -S password=...` to use the credentials locally to setup the server for public-key authentication.

- [ ] Remove check for `user` (https://github.com/genesis/wordpress/blob/master/deployment/deploy.rb#L56-L64), as we should always use the `deploy` user.
- [ ] Create `deploy` on remote server (see SSH/expect tip below).
- [ ] SCP `deploy` user's SSH keys to remote machine.
- [ ] Add password-less sudo for `deploy` (e.g. `%deploy ALL=(ALL) NOPASSWD:ALL`).
- [ ] Let remaining `genesis:provision` with `deploy` user and private key,

Here's a trick to using `expect` to SSH into a machine with a user/pass & execute a command:

```shell
$ expect -c 'spawn ssh $USER@$HOST; \
expect password; \
send "$PASSWORD\n"; \
expect "$ "; \
send "$COMMAND\r"; \
expect "$ "; \
send "exit\r";'
```