Bug 2107113

Summary: Adding SSH keys for core user post-install creates .ssh folder owned by root
Product: OpenShift Container Platform Reporter: Pablo Alonso Rodriguez <palonsor>
Component: Machine Config OperatorAssignee: MCO Bug Bot <mco-triage>
Machine Config Operator sub component: Machine Config Operator QA Contact: Rio Liu <rioliu>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: jerzhang, mkrejci, sburke
Version: 4.10   
Target Milestone: ---   
Target Release: 4.12.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-17 19:52:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pablo Alonso Rodriguez 2022-07-14 11:29:02 UTC
Description of problem:

If a cluster that was created without SSH keys in install-config is added SSH keys post-install, machine-config-daemon creates the "~core/.ssh" folder owned by "root" and not by "core" user, which is wrong and doesn't even mimic ignition behavior (ignition creates the folder with right "core" owner).

Version-Release number of MCO (Machine Config Operator) (if applicable):

4.10.18

Platform (AWS, VSphere, Metal, etc.):

Any

Are you certain that the root cause of the issue being reported is the MCO (Machine Config Operator)?
(Y/N/Not sure): Yes, of course.

How reproducible:

Always

Did you catch this issue by running a Jenkins job? If yes, please list:
No

Steps to Reproduce:
1. Install a cluster without SSH keys
2. Add a SSH key by following https://access.redhat.com/solutions/3868301 (which creates the very same machineconfig than the installation program)
3.

Actual results:

~core/.ssh folder owned by root on existing nodes, which is different behavior than ignition (which creates the folder owned by core)

Expected results:

~core/.ssh owned by core user, like ignition does.

Additional info:

If a new worker is added after having applied the ssh keys machineconfig, its "~core/.ssh" folder has right ownership, because it is created by ignition and not by machine-config-daemon. The issue only impacts the nodes that existed by the time the machine-config with ssh keys is created.

Comment 6 errata-xmlrpc 2023-01-17 19:52:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.12.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:7399