Deploy: Cloning repo git@github.com: Permission denied (publickey) #3775
Unanswered
michal-poplawski
asked this question in
Help needed
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a problem with linking a ssh key to a repository on github.
I have a project on WSL in the Laravel framework that I want to deploy code to VPS. For deploy I am using yours package.
As instructed, I generated a public/private key set using ssh-keygen. In WSL /home/deployer/.ssh/config I have:
On the VPS, I added the public ssh-rsa key to /home/deployer/.ssh/authorized_keys. At this stage everything is ok, it authorises itself to the VPS and all the tasks from
vendor/bin/dep provision -o become=root
are running. A file structure is created at the designated location.According to the instructions, the next step is to run
vendor/bin/dep deploy -o become=root
and here unfortunately I stop at thedeploy:update_code
task (the task is directly from the Laravel Deployer package):When I access the deployer user via PuTTy with the same key as I have on WSL I have no problem cloning the repository:
git clone --mirror git@github.com:my-name/my-repo.git
. On the VPS in /home/deployer/.ssh/config I have:The /home/deployer/.ssh/id_rsa was generated inside the VPS using ssh-keygen.
Of course, I added the deployer public keys from the WSL (id_rsa_deployer) and the one generated inside the VPS (/home/deployer/.ssh/id_rsa) to my github account under Settings -> SSH and GPG keys.
I might also add that I don't have an SSL certificate on the VPS, but I doubt it would make any difference.
Below I add logs from running the command on the VPS:
ssh -vT git@github.com
:I would be grateful for any help, if needed I can send additional information.
Beta Was this translation helpful? Give feedback.
All reactions