Open hanassabio opened 1 year ago
I think this is due to the way web-deploy is copying the key to the web_deploy.key file. If you copy your private key directly to the remote server and do a file compare (cmp in unix) you'll find the files aren't the same, it's added carriage returns
did any one found the solution!
We just had the same problem. This plugin uses node16 base image which apparently is based on old OS docker base image which has pre-7.8 openssh - which needs an old format of the private key.
Hopefully this would be fixed by switching to a new runtime, I'm guessing node18 - but who knows if that has a new-enough openssh.
some problem, i didnt understand if there is a solution
Same problem... maybe I am doing something wrong, but I see others have the problem too... Did anyone find a solution? Thx
@peterhalicky Pointed me to the solution. When generating the ssh private key, you have to make it use PEM as the format:
ssh-keygen -m PEM -t rsa -P "" -f ~/id_rsa
.
@EmileBons and @peterhalicky you legends, thank you for sharing your findings!
I re-created the deploy key using the PEM format:
ssh-keygen -m PEM -t rsa -P "" -f ~/id_rsa
I created the key on my linux laptop. I can ssh into my server with that key without problems. But with rsync this is not working though:
$ rsync -e ssh -p 22 -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no --archive --human-readable --delete-after ./myrepo/build/ user@example.com:/var/my_website/public/
user@example.com's password:
$ ssh user@example.com -i ~/.ssh/deploy_key
Last failed login: Thu Sep 21 23:51:25 UTC 2023 from 200.41.22.221 on ssh:notty
There were 2 failed login attempts since the last successful login.
Last login: Thu Sep 21 23:50:46 2023 from 207.12.88.243
[user@server ~]$
But if I surround the ssh params as a string it works:
rsync -e "ssh -p 22 -i /home/nnieto/.ssh/deploy_key -o StrictHostKeyChecking=no" --archive --human-readable --delete-after ./myrepo/build/ user@example.com:/var/my_website/public/
$ echo $?
0
Bug Description I have tried several different attempts at generating SSH keys (both via github and from cpanel), both fail to connect via web-deploy action. When I try it from my local PC to connect, it's totally fine and authenticates. I have also added the public SSH key to github.
My Action Config
My Action Log