Skip to content

authorizeSSHKeyAdmin function fails to check for missing %ProgramData%\ssh folder leading to excessive error logs #154

@lukasfazik

Description

@lukasfazik

Description

The function authorizeSSHKeyAdmin does not check if the folder %ProgramData%\ssh exists when writing the administrators_authorized_keys file. By default, this folder does not exist in some Windows client or server versions.

This creates unnecessary errors in the log file.

To reproduce

  • Prepare a fresh Windows VM with the affected Windows version
  • Install OpenNebula context version 6.10.0-2
  • Add SSH public key into context
  • Add WINADMIN = "YES" context variable
  • Wait 30+ seconds for context to run and pick up the changes
  • See the Set-Content : Could not find a part of the path 'C:\ProgramData\ssh\administrators_authorized_keys'. error in %SYSTEMDRIVE%.onecontext\opennebula-context.log file and that no %ProgramData%\ssh folder was created with the administrators_authorized_keys inside

Details

  • Affected Component: context-windows
  • Version: 6.10.0-2

Additional context

Possible solutions

  • Write a proper error message into the log when a folder does not exist
  • Create the %ProgramData%\ssh folder

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: context windowsWindows OS contextualization packagescommunityIssue created by OpenNebula Communitystatus: acceptedThe issue is valid and will be planned for fix or implementationtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions