You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Prepare Windows virtual machine
Install OpenNebula context
Add public SSH key into context
Add WINADMIN = "NO" context variable
Wait 30+ seconds for context to run and pick up the changes
See that context portion for setting the SSH key fails and no authorized_keys file is created
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.
Windows has a default setting for SSH Service that all users belonging to the Administrators group share the authorized SSH keys from %PROGRAMDATA%\ssh\admin_authorized_keys. So this feature needs to be disabled when WINADMIN = "NO" since context adds the user in USERNAME context variable to the Administrators group.
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: