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

Configuring a user should not configure root's authorized_keys #3648

Open
ubuntu-server-builder opened this issue May 12, 2023 · 3 comments
Open
Labels
enhancement New feature or request launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1871879

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2020-04-09T16:53:41.587279+00:00
date_fix_committed = None
date_fix_released = None
id = 1871879
importance = wishlist
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1871879
milestone = None
owner = apollo13
owner_name = Florian Apolloner
private = False
status = triaged
submitter = apollo13
submitter_name = Florian Apolloner
tags = []
duplicates = []

Launchpad user Florian Apolloner(apollo13) wrote on 2020-04-09T16:53:41.587279+00:00

When ssh_authorized_keys is configured in user-data keys are unconditionally copied into /root/.ssh/authorized_keys.

If disable_root is set to true it leaks the actual configured username: "Please login as the user XYZ rather than the user root." With disable_root set to false you can login.

It would be great if there were a way to actually disable root and not touch it at all. I fully understand that the info message is useful for new users, but it would be great to have a way to leave root alone.

@ubuntu-server-builder ubuntu-server-builder added enhancement New feature or request launchpad Migrated from Launchpad labels May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Andras Kovacs(andras0602) wrote on 2020-04-09T17:19:57.903239+00:00

It would be great!

Now I do it like:
runcmd:

  • rm -f /root/.ssh/authorized_keys
    But a proper option would be better.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Dan Watkins(oddbloke) wrote on 2020-04-14T14:43:17.798613+00:00

Hi Florian, Andras, thanks for the report and confirmation! Do you have any thoughts on what configuration for this might look like?

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Florian Apolloner(apollo13) wrote on 2020-04-14T15:31:08.351698+00:00

Hi Dan,

thanks for taking this into consideration. My gut-feeling would be an option ala "root_login_help_msg: <true|false>" (Naming is hard). Preferably I'd have it set to false by default but I doubt that will fly :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant