civo / cli-rubygem

Command line interface for interacting with Civo's cloud API
https://www.civo.com
MIT License
15 stars 4 forks source link

Issues with ssh key not being added to new instances #16

Closed alexellis closed 5 years ago

alexellis commented 5 years ago

Generated an SSH key and uploaded it:

civo apikey current production

civo ssh list |grep mini
| 5f81118c-1a69-4ba8-af0a-a73c308b3f51 | alex@space-mini.local | SHA256:PXVGBq8t7Fs4NKYdvZze6d2jR0y2Y4uPdIJB2H6DAzk |

export SSH_KEY_ID="5f81118c-1a69-4ba8-af0a-a73c308b3f51"

Then:

export HOSTNAME="gitops-prod.example.com"

civo instance show "${HOSTNAME}"
export EXISTS=$?
export TEMPLATE="811a8dfb-8202-49ad-b1ef-1e6320b20497"

if [ "${EXISTS}" -ne "0" ]
then
    civo instance create \
    ${HOSTNAME} \
    --template=${TEMPLATE} \
    --ssh="${SSH_KEY_ID}"
fi

Then:

ssh -i ../id_rsa root@185.136.234.165

root@gitops-prod:~# cat .ssh/authorized_keys 

<empty file>
kaihoffman commented 5 years ago

Think this got fixed in 0.3.4 - could you gem install civo_cli to make sure you have the latest version and try again? Could not replicate using that version.

alexellis commented 5 years ago

Great. What did you change?