threefoldtech / cloud-container

A builder for a simple initramfs image to run container over virtiofs inside cloud-hypervisor
Apache License 2.0
0 stars 1 forks source link

Cloud-container shouldn't handle SSH_KEY? #15

Closed OmarElawady closed 11 months ago

OmarElawady commented 2 years ago

cloud-container adds the SSH_KEY env var into ~/.ssh/authorized_keys without a new line. In most flists, we do echo $SSH_KEY >> ~/.ssh/authorized_keys. Which causes the key ssh-rsa something to appear in the file as ssh-rsa somethingssh-rsa something which is invalid and prevents ssh access. When SSH_KEY is with the email after it, it appears as ssh-rsa something emailssh-rsa something email and it's recognized correctly.

But why does the cloud-container does this? it seems something the image should be handling. And if it does it would be convenient to add a new line so that existing images doesn't break.

xmonader commented 2 years ago

@muhamadazmy please look into it

scottyeager commented 11 months ago

The newline was added in https://github.com/threefoldtech/cloud-container/commit/b9ac00257460af920925e4dcc22c8e82bcffe9da.