Broken authorization of standard SSH public keys on Windows #150
Labels
category: context windows
Windows OS contextualization packages
community
Issue created by OpenNebula Community
status: accepted
The issue is valid and will be planned for fix or implementation
type: bug
Something isn't working
Milestone
Description
The function authorizeSSHKeyStandard() in context.ps1 (context-windows) uses $env:USERPROFILE variable when storing the user's public key. Because the contextualization service runs as a local system account, the resulting value for this environment variable is C:\WINDOWS\system32\config\systemprofile\, which is not expected behavior.
Also, the function uses .ssh folder instead of authorized_keys file when calling Set-Content cmdlet to write the public keys into a file. This operation fails.
To Reproduce
Expected behavior
The USERNAME context variable should be used instead (like in context-linux). Also, a check should be performed to see if the user profile exists before forcefully creating .ssh directory. This avoids messing up the permissions for the future user profile directory.
Details
Additional context
Progress Status
The text was updated successfully, but these errors were encountered: