ChimeraOS / chimera

A web interface for managing Steam remotely
MIT License
233 stars 27 forks source link

Adding SSH public key doesn't seem to work #313

Open Prodeguerriero opened 2 months ago

Prodeguerriero commented 2 months ago

Hi there,

I have tried to add my SSH key to my ChimeraOS installation (running on a Framework 13 laptop with AMD APU), but even though I don't get any error message from the UI, the “transfer” doesn't appear to work. The ssh call works, and I can add the target machine's fingerprint to my known_hsots file, but then I am greeted by gamer@chimeraos.local: Permission denied (publickey).

I have had a look inside the .ssh folder of the gamer user by using TTY, and I don't see the authorized_keys file in there.

I am running the OS on a laptop, so having SSH access for me isn't exactly critical. But I thought I would flag it nonetheless. Let me know if I can help by looking further into the matter.

alkazar commented 2 months ago

Is the key listed in the web app? Perhaps you didn't click the "Save" button?

Prodeguerriero commented 2 months ago

Is the key listed in the web app? Perhaps you didn't click the "Save" button?

The key is not listed in the web app. I did click the save button. I'll try again later today, just to confirm.

EDIT: might be worth pointing out that other features work. I was able to install games from my Epic and Gog libraries, for example. And I configured a fixed login password.

alkazar commented 2 months ago

What kind/type of key did you upload? There may be some that do not work.

Prodeguerriero commented 2 months ago

It's a Ed25519 key generated with 1Password. Did I miss the requirement somewhere?

Prodeguerriero commented 2 months ago

I have just tried with an RSA key, still nothing. And I have tested this with Firefox and Chrome.

alkazar commented 2 months ago

I was able to reproduce if I copied the key without the label/id. Make sure to copy the full contents of the public key file.

Prodeguerriero commented 2 months ago

Bingo, the problem was the missing [comment] in the public key. Thanks!

Now that we are at it, I think it is worth pointing out that 1Password generates public keys that do not have a comment. A bit of a corner case, I know. But still, it might not be the only password manager that does this.

If you point me in the right direction, I could look at the documentation and update it. Or even look at the code and build error handling for this use case. If you are fine with others poking around in the codebase, that is. I found the documentation, I'll start there.

alkazar commented 2 months ago

Oh, that is good to know. I suppose we can detect when it is missing and add one automatically. Or maybe it is not even needed? I am not sure. The validation is quite basic and can be found here: https://github.com/ChimeraOS/chimera/blob/master/chimera_app/ssh_keys.py#L92

Prodeguerriero commented 2 months ago

I think the easiest thing to do is to edit the documentation to mention that a comment is needed. Knowing that requires a simple copy/paste exercise to work around the requirement.

I say this mainly because the comment appears to be what the UI/web page uses when listing the added keys.