Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20.0.0 Adding multiple authorized_keys fail #838

Closed
devastgh opened this issue Jan 27, 2025 · 4 comments
Closed

20.0.0 Adding multiple authorized_keys fail #838

devastgh opened this issue Jan 27, 2025 · 4 comments

Comments

@devastgh
Copy link

devastgh commented Jan 27, 2025

According to the documentation:
Note: Please ensure the keys are specified as a list by pasting within the [] comma delimited.
This does not generate a proper authorized_keys file. The generated file will have one line with comma between keys.
The authrozed_keys file format mandates each key to be in a new line.
Either the documentation needs to be fixed, mandating an empty line between each key like:

authorized_keys:
  - >
    ssh-ed25519
    AAAAC3Nzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx whatever

    ssh-ed25519
    AAAAC3Nzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx whatever2

    ssh-ed25519
    AAAAC3Nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    whatever3.whatnot.com

or the script needs to be fixed that generates the file.

@sinclairpaul
Copy link
Member

On save in the config, a List should be generated (as specified in the docs), i.e.:

If you paste ssh-ed25519 AASD2342124124CNALCMLAK234234AASDJ, ssh-ed25519 AASDJKJKJFWJFAFLCNALCML23134555 within the brackets and click save you get:

authorized_keys:
  - ssh-ed25519 AASD2342124124CNALCMLAK234234AASDJ
  - ssh-ed25519 AASDJKJKJFWJFAFLCNALCML23134555

Which generates:

ssh-ed25519 AASD2342124124CNALCMLAK234234AASDJ
ssh-ed25519 AASDJKJKJFWJFAFLCNALCML23134555

Not sure why this isn't occurring for you.

@devastgh
Copy link
Author

devastgh commented Jan 27, 2025

I checked again. I'm using the UI configuration. If i paste ssh-ed25519 AASD2342124124CNALCMLAK234234AASDJ, ssh-ed25519 AASDJKJKJFWJFAFLCNALCML23134555 then apply and restart the addon, the configuration window will show this:

authorized_keys:
  - >-
    ssh-ed25519
    AAAAC3xxxxxxxxxxxxxxxxxx,
    ssh-ed25519
    AAAAC3NzaCxxxxxxxxxxxxx,
    ssh-ed25519
    AAAAC3Nzaxxxxxxxxxxxxxx

This will not generate good authorized_keys file.
However, if add each key like this:

authorized_keys:
  - ssh-ed25519 AAAACxxxxxxxxxxxxx
  - ssh-ed25519 AAAACxxxxxxxxxxxxxxxxx
  - ssh-ed25519 AAAACxxxxxxxxxxx

then i apply and restart, it will work good and the configuration will show this:

authorized_keys:
  - >-
    ssh-ed25519
    AAAAC3NzaCxxxxxxxxxxxxxxx
  - >-
    ssh-ed25519
    AAAAC3NzaCxxxxxxxxxxxxxxx
  - >-
    ssh-ed25519
    AAAAC3NzaCxxxxxxxxxxxxxxx

This will also generate a good key file.
I can't seem to produce a valid key file with , as a delimiter.
Are you sure it works for you? Test with the second key (the first always works, whatever you write after it), or simply check /etc/ssh/authorized_keys if it has the proper format.

@sinclairpaul
Copy link
Member

Are you sure it works for you?

Yep

Image

@devastgh
Copy link
Author

Are you sure it works for you?

Yep

Thanks, that clears up things for me. I think what confused me was that applying a config rewrites the formatting. The empty [] brackets are only visible after you install the addon and go into the configuration. First i used a single key. Then i wanted to add more, so i went into the doc to read how to do that, and assumed it would be like:

authorized_keys:
    - [key1, key2, key3]

That didn't work, hence i assumed it's a bug.

@sinclairpaul sinclairpaul closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants