Trellis Deploy - Permission Denied on Clone Project

Hi there! I’ve deployed my site once before after about a day of fiddling around until it finally deployed. As far as I know my SSH keys are set fine however when I run:

./deploy.sh staging staging.example.com

I receive this error:

TASK: [deploy | Clone project files] ****************************************** 
failed: [xxx.xx.xxx] => {"cmd": "/usr/bin/git ls-remote origin -h refs/heads/master", "failed": true, "rc": 128}
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

msg: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

When I run:

ssh -T git@github.com

On my local machine and my staging DO server they both authenticate to my Git username. I’ve spent the day trying to diagnose the issue and haven’t figured out much. I’m still very new to Trellis and Ansible so I may just be overlooking something. I haven’t adjusted anything in group_vars since the site successfully deployed which leads me to believe this should be an easy fix adjusting SSH keys.

Edit: I’ve solved this by setting the keys in users.yml to:

https://github.com/myusername.keys

I suppose they were using two different keys.

1 Like