wshihadeh / docker-deployment-action

A GitHub Action that supports docker-compose and Docker Swarm deployments
https://docs.shihadeh.dev
MIT License
132 stars 75 forks source link

`ssh_public_key` input is misleading #33

Open diericx opened 1 year ago

diericx commented 1 year ago

I ran into these errors while trying to set up the connection

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

And

load pubkey "/github/home/.ssh/id_rsa": invalid format

What this script does is appends the host value and the ssh_public_key value to a new line in the known_hosts file here https://github.com/wshihadeh/docker-deployment-action/blob/878e5822321b7acbcee5fe5fdb926d61d27656d6/docker-entrypoint.sh#L85

So like other issues have mentioned, if you look at your own ~/.ssh/known_hosts file on a local computer that has connected to the server you will see something like this:

1.2.3.404 ssh-rsa LONGKEYHERE

What you really want to do is take everything after the IP as that is being added on later. So the value will look like this:

ssh-rsa LONGKEYHERE

I think that is pretty confusing. What is the rationale for not simply letting the user put the ip in the key secret variable? To hit other hosts with the same key?

XDynames commented 7 months ago

Insanely helpful +1