Staging Server Asking for SSH Password on Deploy

When I run ansible-playbook -i hosts/staging server.yml, I get this far:

PLAY [Determine Remote User] **************************************************

TASK: [remote-user | Determine whether to connect as root or admin_user] ******

Until this pops up:

The strange thing is that I can login to my root SSH without a password, but Trellis keeps asking for it on the deploy.

Even when I do set it up with a passphrase, it doesn’t work if I put it in. I think I’ve read somewhere that’s because Trellis doesn’t work with a passphrase.

Once I cancel out, I get this:

GATHERING FACTS ***************************************************************
fatal: [159.203.240.149] => SSH Error: Permission denied (publickey).
    while connecting to 159.203.240.149:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

TASK: [common | Validate Ansible version] *************************************
FATAL: no hosts matched or all hosts have already failed -- aborting


PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/Mason/server.retry

159.203.240.149            : ok=3    changed=0    unreachable=1    failed=0

Here’s the repo I’m working off of.

Anyone have any thoughts? Seems like it’s probably something small and obvious, but no luck so far.

This isn’t exactly a Trellis issue itself. That’s an OSX feature with how it integrates SSH keys.

Maybe check out this: http://apple.stackexchange.com/a/26252

One other thing from your repo is that you don’t need both the local lookup key AND GitHub keys. Your local key is probably on GitHub anyway, so you can just go with one of them (unless they really are different).

1 Like

Hey thanks!

I actually woke up and gave it another try before attempting the Apple Exchange thread you linked.

When I opened up my Github Desktop App, it prompted me for my password.

When I ran the playbook again, it worked.

So just for documentation purposes:
I think my issue was probably because my Github App. If anyone runs into this issue, I’d try rebooting your Github App and re-entering your SSH password when prompted.

@swalkinshaw, my ssh keys are the same. Are you referring to trellis/group_vars/all/users.yml?

One other thing from your repo is that you don’t need both the local lookup key AND GitHub keys. Your local key is probably on GitHub anyway, so you can just go with one of them (unless they really are different).

Thanks!

Yep, I was referring to that.

1 Like