I’m trying to add another public key to the Advanced SSH & Web Terminal (v20.0.2) options. But when I restart the add-on the newly added key vanishes. I must be mising something obvious.
The add-on documentation does mention using multiple keys. But, I’m unable to change any config option and have it stick.
I’ve tried adding the key in the add-on’s configuration and after a restart the added key no longer shows in the config.
I even tried stopping the add-on, then editing on HAOS the options.json file directly, and restarting. Note, this is on the host OS, not the HA container.
Haven’t used the SSH addon in a while and no longer have it installed, so take the following advice with a pinch of salt:
Instead of editing the json file, have you tried to add the keys as a yaml list in the addon config page, like the example in the doc hints at?
I added the second key and comments for clarity - the rest is straight from the example.
I then hit “Save” at the bottom of the config screen, I then click on Info at the top of the page to move away from the config screen and then click back on Configuration and everything is reverted:
This is too weird so I must be doing something wrong. That’s why I stopped the add-on and ssh’d into the host OS and edited the add-on’s options.json file directly. Isn’t /mnt/data/supervisor/addons/data/a0d7b954_ssh/options.json what is mapped into the container when the add-on starts?
If I change the option in the host OS it is the same as in the add-on’s container:
Does the connection for [email protected] actually work by itself though? I don’t recall having to add my username to the key.
I’m not even sure of the addon supports multiple usernames/connections for different users, in fact.
Hopefully someone with more recent experience will show up to help you.
Remove the comment. I think that’s the cause of your issues, though I could obviously be wrong.
Managed to track down my old privkey config, and it doesn’t contain any comments. I have a feeling the space before the comment doesn’t cooperate with multiple keys.
EDITED TO ADD: Make sure you have no trailing spaces at the end of the key when removing your comment
Yeah. I did that the first time. (And it’s not the first time that has caught me.)
But then I was editing in YAML mode and then when I switched back to UI mode the option was vanishing (or resetting). Is that a bug? In automations and scripts uyo can toggle between YAML and UI mode.
I assumed the options.json file in the host OS was the store for the options, but I see now that it is written when the plugin starts. Big mistake on my part.
I can stop a add-on and change config, restart HA and the config persists. Do you know where HA stores the add-ons config that gets written to options.json?
Not sure if there’s a bug or not for that activity. I just used the UI mode, added extra keys and use the Save button the Options panel. It worked fine with comments and all.